From 5777dd5908405935c58d0556f028a2a773e9b67d Mon Sep 17 00:00:00 2001 From: team3 Date: Wed, 2 Sep 2026 19:36:53 +0200 Subject: [PATCH] =?UTF-8?q?Vorschlag=20umschaltbar,=20Wertungen=20einzeln?= =?UTF-8?q?=20l=C3=B6schbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wer einen Film aufs Rad gesetzt hat, kann ihn dort auch wieder runternehmen. Im Raster tragen alle Filme auf dem Rad jetzt eine Marke, nicht nur der eigene Vorschlag — so sieht man auf einen Blick, was schon vorgeschlagen ist. Die Karten hören dafür am Live-Kanal mit. Dazu: der Host löscht einzelne Wertungen, das Cover dockt oben an statt mittig, und die Suche heißt schlicht "Globale Suche". Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013XVnRop5c3or3B8xE2hpgZ --- backend/app/main.py | 9 +++++++ backend/app/watched.py | 13 +++++++++-- frontend/src/App.vue | 19 ++++++++++++++- frontend/src/components/MovieCard.vue | 31 ++++++++++++++++++++++++- frontend/src/components/MovieDetail.vue | 26 +++++++++++++++++---- frontend/src/components/SearchTab.vue | 2 +- frontend/src/components/SeriesCard.vue | 27 ++++++++++++++++++++- frontend/src/components/WatchedTab.vue | 27 ++++++++++++++++++++- 8 files changed, 142 insertions(+), 12 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index 7625988..e57dae9 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -315,6 +315,15 @@ def bewerten( return eintrag +@app.delete("/api/watched/rating/{rating_id}") +def wertung_loeschen(rating_id: int): + """Der Host räumt eine einzelne Wertung weg.""" + if not watched.stimme_loeschen(rating_id): + raise HTTPException(status_code=404, detail="Wertung nicht gefunden") + events.senden("watched") + return {"removed": 1} + + @app.delete("/api/suggestions/alle") def runde_zuruecksetzen(): """Host leert die Runde: Vorschläge weg, Rad wieder leer.""" diff --git a/backend/app/watched.py b/backend/app/watched.py index 6e27de7..0c7da39 100644 --- a/backend/app/watched.py +++ b/backend/app/watched.py @@ -59,7 +59,7 @@ def alle(session_id): "SELECT * FROM watched ORDER BY watched_at DESC, id DESC" ).fetchall() stimmen = conn.execute( - "SELECT watched_id, session_id, stars, name FROM ratings " + "SELECT id, watched_id, session_id, stars, name FROM ratings " "ORDER BY created_at ASC" ).fetchall() @@ -75,7 +75,8 @@ def alle(session_id): { **dict(film), "ratings": [ - {"stars": s["stars"], "name": s["name"]} for s in eigene + {"id": s["id"], "stars": s["stars"], "name": s["name"]} + for s in eigene ], "average": round(sum(werte) / len(werte), 1) if werte else None, "count": len(werte), @@ -163,6 +164,14 @@ def bewerten(watched_id, session_id, stars, name=None): return {"watched_id": watched_id, "stars": stars} +def stimme_loeschen(rating_id): + """Der Host räumt eine einzelne Wertung weg.""" + with connect() as conn: + return conn.execute( + "DELETE FROM ratings WHERE id = ?", (rating_id,) + ).rowcount + + def ids(): """movie_ids der geschauten Filme, für die Detailansicht.""" with connect() as conn: diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 84713bd..6dd5851 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,6 @@ diff --git a/frontend/src/components/MovieCard.vue b/frontend/src/components/MovieCard.vue index 998dde0..84a086a 100644 --- a/frontend/src/components/MovieCard.vue +++ b/frontend/src/components/MovieCard.vue @@ -4,6 +4,7 @@ import { posterUrl } from '../images' const props = defineProps({ movie: { type: Object, required: true }, + aufDemRad: { type: Boolean, default: false }, }) defineEmits(['open']) @@ -21,7 +22,13 @@ const meta = computed(() =>