From c89cecd43fa94a8dcbdea15c00823cd3b9e03823 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Tue, 20 Jan 2026 13:19:02 +0100 Subject: [PATCH] Update engine.py --- engine.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine.py b/engine.py index 55c0439..02f9944 100644 --- a/engine.py +++ b/engine.py @@ -540,6 +540,11 @@ class SorterEngine: conn = sqlite3.connect(SorterEngine.DB_PATH) cursor = conn.cursor() + # Ensure table exists (for existing databases) + cursor.execute('''CREATE TABLE IF NOT EXISTS folder_tags + (folder_path TEXT, filename TEXT, category TEXT, tag_index INTEGER, + PRIMARY KEY (folder_path, filename))''') + saved_count = 0 for orig_path, info in staged.items(): # Only save tags for files that are in this folder (or subfolders) @@ -572,6 +577,11 @@ class SorterEngine: conn = sqlite3.connect(SorterEngine.DB_PATH) cursor = conn.cursor() + # Ensure table exists (for existing databases) + cursor.execute('''CREATE TABLE IF NOT EXISTS folder_tags + (folder_path TEXT, filename TEXT, category TEXT, tag_index INTEGER, + PRIMARY KEY (folder_path, filename))''') + # Get saved tags for this folder cursor.execute( "SELECT filename, category, tag_index FROM folder_tags WHERE folder_path = ?",