Update engine.py
This commit is contained in:
@@ -574,6 +574,7 @@ class SorterEngine:
|
||||
Call this when loading/reloading a folder.
|
||||
Returns the number of tags restored.
|
||||
"""
|
||||
try:
|
||||
conn = sqlite3.connect(SorterEngine.DB_PATH)
|
||||
cursor = conn.cursor()
|
||||
|
||||
@@ -581,6 +582,7 @@ class SorterEngine:
|
||||
cursor.execute('''CREATE TABLE IF NOT EXISTS folder_tags
|
||||
(folder_path TEXT, filename TEXT, category TEXT, tag_index INTEGER,
|
||||
PRIMARY KEY (folder_path, filename))''')
|
||||
conn.commit()
|
||||
|
||||
# Get saved tags for this folder
|
||||
cursor.execute(
|
||||
@@ -620,6 +622,9 @@ class SorterEngine:
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return restored
|
||||
except Exception as e:
|
||||
print(f"Error restoring folder tags: {e}")
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def clear_folder_tags(folder_path):
|
||||
|
||||
Reference in New Issue
Block a user