From c35e3acf494456a9ab66a307aee8eae9f167d8ed Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 5 Mar 2023 17:04:44 +0300 Subject: [PATCH] Feat(reload_db): Get existing row by id --- reload_db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reload_db.py b/reload_db.py index ff1c3a6..d60e3ec 100755 --- a/reload_db.py +++ b/reload_db.py @@ -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')} -- 2.39.5