Filme: DB-Migration, 68 Einträge, Sort + Typ-Filter

- movies-Tabelle in SQLite (statt hardcoded Liste)
- seed_movies(): 68 Filme/Serien/Dokus beim ersten Start
- Felder: titel, originaltitel, jahr, genre, typ, hund_rasse,
  stirbt_der_hund, beschreibung, bild_emoji, imdb_rating, streaming
- GET /api/movies/filme?sort=&typ= — serverseitig sortiert
  Sort: default | titel | jahr_desc | jahr_asc | imdb | bewertung
  Typ: alle | film | serie | doku
- Admin-CRUD: POST/PATCH/DELETE /api/movies/filme
- Frontend: Sort-Dropdown, Typ-Filter-Buttons (Filme/Serien/Dokus),
  Zähler, IMDb-Rating + Streaming auf der Karte
- Promis ebenfalls erweitert (10 statt 6 Einträge)
This commit is contained in:
rene 2026-05-01 08:50:01 +02:00
parent de1677154f
commit 59856e61a1
4 changed files with 350 additions and 113 deletions

View file

@ -701,7 +701,28 @@ def _migrate(conn_factory):
CREATE INDEX IF NOT EXISTS idx_wiki_berichte_rasse ON wiki_berichte(rasse, created_at DESC);
""")
# Hunde-Filme: Bewertungen + Hund des Monats
# Hunde-Filme: Katalog + Bewertungen + Hund des Monats
conn.executescript("""
CREATE TABLE IF NOT EXISTS movies (
id TEXT PRIMARY KEY,
titel TEXT NOT NULL,
originaltitel TEXT,
jahr INTEGER,
genre TEXT,
typ TEXT NOT NULL DEFAULT 'film',
hund_rasse TEXT,
stirbt_der_hund INTEGER NOT NULL DEFAULT 0,
beschreibung TEXT,
bild_emoji TEXT DEFAULT '🐾',
imdb_rating REAL,
streaming TEXT,
sort_order INTEGER DEFAULT 0,
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);
CREATE INDEX IF NOT EXISTS idx_movies_typ ON movies(typ);
CREATE INDEX IF NOT EXISTS idx_movies_jahr ON movies(jahr DESC);
""")
conn.executescript("""
CREATE TABLE IF NOT EXISTS movie_votes (
id INTEGER PRIMARY KEY AUTOINCREMENT,