From: Oleg Broytman Date: Sun, 5 Mar 2023 14:04:44 +0000 (+0300) Subject: Feat(reload_db): Get existing row by id X-Git-Tag: 5.1.0~17 X-Git-Url: https://git.phdru.name/?p=xsetbg.git;a=commitdiff_plain;h=c35e3acf494456a9ab66a307aee8eae9f167d8ed Feat(reload_db): Get existing row by id --- 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')}