summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-07 00:04:38 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-07 00:04:38 -0700
commitefd4f1ea3cf9f3d7335ed718c5d7fd44354147f9 (patch)
treef4f442d4738cc09df0deaf8065194ff92d398bf4
parentd90430bbec3739df43b261618816077598499648 (diff)
Remove rewatch rate metric
The rewatch rate (percentage of films rewatched) is less useful than the detailed rewatch patterns panel. Removed the metric section from both the template and backend payload. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
-rw-r--r--routers/stats.py6
-rw-r--r--templates/stats.html17
2 files changed, 0 insertions, 23 deletions
diff --git a/routers/stats.py b/routers/stats.py
index 2abc493..15063cb 100644
--- a/routers/stats.py
+++ b/routers/stats.py
@@ -65,7 +65,6 @@ def _build_stats_payload(films: list[Film]) -> dict:
watched_with["solo"] += 1
total_watched = len(films)
- rewatched = sum(1 for film in films if film.rewatch or film.rewatch_count > 0)
title_groups = defaultdict(list)
for film in films:
@@ -137,11 +136,6 @@ def _build_stats_payload(films: list[Film]) -> dict:
for watched_date, count in sorted(days.items())
],
"films_per_day_365": trailing_days,
- "rewatch_rate": {
- "rewatched": rewatched,
- "total_watched": total_watched,
- "rate": round(rewatched / total_watched, 4) if total_watched else 0,
- },
"rewatch_patterns": rewatch_details,
"watched_with_breakdown": [
{"watched_with": watched_with_value, "count": count}
diff --git a/templates/stats.html b/templates/stats.html
index 34d796e..797054a 100644
--- a/templates/stats.html
+++ b/templates/stats.html
@@ -62,16 +62,6 @@
<section class="stats-panel">
<div class="stats-panel-header">
<div>
- <p class="eyebrow">Rewatch</p>
- <h2>Rate</h2>
- </div>
- </div>
- <div id="rewatch-rate" class="stats-metric"></div>
- </section>
-
- <section class="stats-panel">
- <div class="stats-panel-header">
- <div>
<p class="eyebrow">Films</p>
<h2>Rewatches</h2>
</div>
@@ -168,13 +158,6 @@
</div>
`).join("");
- const rewatchRate = document.getElementById("rewatch-rate");
- const rate = data.rewatch_rate.total_watched ? Math.round(data.rewatch_rate.rate * 100) : 0;
- rewatchRate.innerHTML = `
- <strong>${rate}%</strong>
- <span>${data.rewatch_rate.rewatched} of ${data.rewatch_rate.total_watched} watched films were rewatches.</span>
- `;
-
const rewatchPatterns = document.getElementById("rewatch-patterns-list");
if (data.rewatch_patterns && data.rewatch_patterns.length > 0) {
rewatchPatterns.innerHTML = data.rewatch_patterns.map((item) => {