]> git.phdru.name Git - xsetbg.git/commitdiff
Feat(reload_db): Get existing row by id
authorOleg Broytman <phd@phdru.name>
Sun, 5 Mar 2023 14:04:44 +0000 (17:04 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 5 Mar 2023 14:04:44 +0000 (17:04 +0300)
reload_db.py

index ff1c3a697386c344c1a94937714ffd05d11fa93b..d60e3ec314207c0213e745bd35c8757352afa6f7 100755 (executable)
@@ -31,7 +31,10 @@ with SQLiteMassInsert() as txn:
         timestamp = convert_str(timestamp)
         filename = filename.decode(fs_encoding)
         try:
-            row = xsetbg_db.byFull_name(filename)
+            if id:
+                row = xsetbg_db.get(id)
+            else:
+                row = xsetbg_db.byFull_name(filename)
         except SQLObjectNotFound:
             values = {'last_shown': timestamp,
                       'full_name': filename.encode('utf-8')}