Convert boolean flags to integers for SQLite (#59)

This commit is contained in:
l5y
2025-09-15 13:37:30 +02:00
committed by GitHub
parent 648bcc9b92
commit 6d948603c9
+9 -2
View File
@@ -95,6 +95,13 @@ def upsert_node(db, node_id, n)
pt = nil if pt && pt > now
lh = now if lh && lh > now
lh = pt if pt && (!lh || lh < pt)
bool = ->(v) {
case v
when true then 1
when false then 0
else v
end
}
row = [
node_id,
n["num"],
@@ -104,8 +111,8 @@ def upsert_node(db, node_id, n)
user["hwModel"] || n["hwModel"],
role,
user["publicKey"],
user["isUnmessagable"],
n["isFavorite"],
bool.call(user["isUnmessagable"]),
bool.call(n["isFavorite"]),
n["hopsAway"],
n["snr"],
lh,