X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=reload_db.py;h=9dbbd02f68e0d48dfcb6241e411d280c036bb9d2;hb=18151a095e176678f48555b53083c96c2b995501;hp=060b05c3c08009d09e377945309a9a162d73c1ca;hpb=1bf04fe0782d08411f0ee876defd6fc11dd3f884;p=xsetbg.git diff --git a/reload_db.py b/reload_db.py index 060b05c..9dbbd02 100755 --- a/reload_db.py +++ b/reload_db.py @@ -32,12 +32,12 @@ with SQLiteMassInsert() as txn: id, timestamp, filename = line.strip().split(None, 2) id = convert_str(id) timestamp = convert_str(timestamp) - if fs_encoding != 'utf-8': - filename = filename.decode(fs_encoding).encode('utf-8') + filename = filename.decode(fs_encoding) try: row = xsetbg_db.byFull_name(filename) except SQLObjectNotFound: - values = {'last_shown': timestamp, 'full_name': filename} + values = {'last_shown': timestamp, + 'full_name': filename.encode('utf-8')} if id: values['id'] = id query = txn.sqlrepr(Insert(xsetbg_db.sqlmeta.table, values=values))