From 4279408876268f4960c98492d3814f5475e36e38 Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Tue, 12 May 2026 03:15:17 -0700 Subject: Add stats totals, runtime summary, and duplicate detection on add form - Stats page now shows total films watched and total runtime (formatted as Xd Yh) in an overview panel above the world map - /stats/data endpoint includes total_runtime_minutes in payload - New GET /films/find endpoint returns all shelf matches for a tmdb_id - Add film form shows an inline notice when the selected TMDB film is already logged, with shelf name, date, and a link to the entry - Update CLAUDE.md and README to reflect current auth, OMDb, and router/service structure Co-Authored-By: Claude Sonnet 4.6 --- routers/stats.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'routers/stats.py') diff --git a/routers/stats.py b/routers/stats.py index 15063cb..d600e5a 100644 --- a/routers/stats.py +++ b/routers/stats.py @@ -65,6 +65,7 @@ def _build_stats_payload(films: list[Film]) -> dict: watched_with["solo"] += 1 total_watched = len(films) + total_runtime_minutes = sum(film.runtime for film in films if film.runtime) title_groups = defaultdict(list) for film in films: @@ -103,6 +104,7 @@ def _build_stats_payload(films: list[Film]) -> dict: "requires_date_watched": True, }, "total_watched": total_watched, + "total_runtime_minutes": total_runtime_minutes, "films_per_country": [ {"country": country, "count": count} for country, count in sorted(countries.items(), key=lambda item: (-item[1], item[0])) -- cgit v1.3-2-g0d8e