Commit Diff


commit - 7b7448427bf4aaf98c1b971912ee90f68f793cef
commit + da7270e14b4f810371885c511c8759b8de007235
blob - f921a5993b14bb81a42f353e22e0ec66cd1d724d
blob + edaab424439a0b9fa01c3353b276d9006bc1c348
--- lonk.py
+++ lonk.py
@@ -108,10 +108,6 @@ class HtmlToGmi(HTMLParser):
         return "\n".join(gmi_text for gmi_text in self.gmi_text if gmi_text)
 
     def handle_starttag(self, tag, attrs):
-        # print(f" > {tag=}")
-
-        # https://humungus.tedunangst.com/r/webs/v/tip/f/htfilter/html.go
-
         def _push(elem):
             if self.stack:
                 self.gmi_text.append(self.stack[-1].flush())
@@ -148,13 +144,11 @@ class HtmlToGmi(HTMLParser):
                 self.gmi_text.append(self.stack[-1].flush())
 
     def handle_data(self, data):
-        # print(f" . {data=}")
         if not self.stack:
             self.stack.append(ParagraphTag("p", []))
         self.stack[-1].on_data(data)
 
     def handle_endtag(self, tag):
-        # print(f" < {tag=}")
         if self.stack and tag == self.stack[-1].tag:
             self.gmi_text.append(self.stack.pop().flush())
 
@@ -240,6 +234,16 @@ def _create_schema(db_con):
     db_con.execute(
         """
         CREATE TABLE
+            client_settings (
+                client_id INTEGER,
+                media_gemini_proxy INTEGER,
+                FOREIGN KEY (client_id) REFERENCES client (client_id)
+            )
+        """
+    )
+    db_con.execute(
+        """
+        CREATE TABLE
             convoy (
                 convoy_id INTEGER PRIMARY KEY,
                 convoy TEXT,
@@ -265,9 +269,18 @@ def _create_schema(db_con):
                 mime TEXT,
                 alt_text TEXT,
                 FOREIGN KEY (convoy_id) REFERENCES convoy (convoy_id)
+            )
+        """
+    )
+    db_con.execute(
+        """
+        CREATE TABLE
+            meta (
+                db_schema_version INTEGER
             )
         """
     )
+    db_con.execute("INSERT INTO meta(db_schema_version) VALUES (?)", (1, ))
 
 
 def db_connect():