From 3f17203976a1498c7044db9b7b4d8cbb1fa12b9e Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 9 May 2026 16:07:08 +0200 Subject: [PATCH] fix: use named columns in tmdb_cache INSERT to handle migration column order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ALTER TABLE ADD COLUMN appends at the end of existing tables, but CREATE TABLE defines year before cached_at — positional VALUES mapped year→cached_at (NOT NULL). Co-Authored-By: Claude Sonnet 4.6 --- tmdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmdb.py b/tmdb.py index d15aefc..a0993ce 100644 --- a/tmdb.py +++ b/tmdb.py @@ -100,7 +100,7 @@ def lookup(arte_id: str, title: str, subtitle: str) -> dict | None: with sqlite3.connect(_DB) as conn: conn.execute( - "INSERT OR REPLACE INTO tmdb_cache VALUES (?,?,?,?,?,?)", + "INSERT OR REPLACE INTO tmdb_cache (arte_id, tmdb_id, poster, backdrop, year, cached_at) VALUES (?,?,?,?,?,?)", (arte_id, tmdb_id, poster, backdrop, year, datetime.now().isoformat()), )