feat: add recommendation feedback
CI / test (push) Successful in 19s

This commit is contained in:
strsv committed 2026-11-06 09:20:28 +03:00
1 parent f25d218756
commit 044d0279b3
17 files changed
+288 -20

No files matched your search

+17 -1
View File
@@ -8,7 +8,7 @@ from datetime import datetime, timezone
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_DB = os.path.join(BASE_DIR, "steam.db")
SCHEMA_PATH = os.path.join(BASE_DIR, "tools", "schema.sql")
SCHEMA_VERSION = 2
SCHEMA_VERSION = 3
MOOD_PRESETS = {
"adventure-rpg-party": {
@@ -329,9 +329,25 @@ def _migration_2(con):
refresh_search_index(con)
def _migration_3(con):
"""Add per-mood recommendation feedback."""
con.execute("""
CREATE TABLE IF NOT EXISTS reco_feedback (
appid INTEGER NOT NULL REFERENCES games(appid) ON DELETE CASCADE,
mood_key TEXT NOT NULL,
verdict TEXT NOT NULL CHECK (verdict IN ('like','dislike','played','ignore')),
created_at TEXT NOT NULL,
PRIMARY KEY (appid, mood_key)
)
""")
con.execute("CREATE INDEX IF NOT EXISTS idx_reco_feedback_mood "
"ON reco_feedback(mood_key, verdict)")
MIGRATIONS = {
1: _migration_1,
2: _migration_2,
3: _migration_3,
}