From 6d948603c99ecdc523660f29aec539a6b320fa55 Mon Sep 17 00:00:00 2001 From: l5y <220195275+l5yth@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:37:30 +0200 Subject: [PATCH] Convert boolean flags to integers for SQLite (#59) --- web/app.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/app.rb b/web/app.rb index cb5ab36..552671d 100644 --- a/web/app.rb +++ b/web/app.rb @@ -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,