Add search history with saved results
Saves each mood search and its recommendations to SQLite per user. Recent searches appear below the results area with mood text, top movie titles, and timestamp. Click any entry to reload those results. Entries can be deleted individually. History toggleable via show/hide. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d5de06b44
commit
d8c8b473ad
4 files changed
+178
-10
No files matched your search
@@ -59,6 +59,15 @@ async def init_database():
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS search_history (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
user_id TEXT NOT NULL,
|
||||
mood TEXT NOT NULL,
|
||||
results TEXT NOT NULL,
|
||||
meta TEXT,
|
||||
created_at TEXT NOT NULL
|
||||
);
|
||||
""")
|
||||
await db.commit()
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user