From 619718c045972bff546df40bb303601300cd5af0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 30 Jun 2026 16:04:09 -0400 Subject: [PATCH] [charts] Fix chart page missing tables --- vrobbler/apps/charts/views.py | 32 +++++++++++++------ vrobbler/templates/scrobbles/_top_charts.html | 6 ++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/vrobbler/apps/charts/views.py b/vrobbler/apps/charts/views.py index 65fd547..d5882eb 100644 --- a/vrobbler/apps/charts/views.py +++ b/vrobbler/apps/charts/views.py @@ -233,55 +233,67 @@ class ChartRecordView(TemplateView): }, } + # List-group tables default to week-level when no date param (matches active tab) + if not date_param: + list_year = current_year + list_month = None + list_week = current_week + list_day = None + else: + list_year = year + list_month = month + list_week = week + list_day = day + context["charts"] = { "artist": list( self.get_charts_for_period( - user, "artist", year=year, month=month, week=week, day=day, limit=20 + user, "artist", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "album": list( self.get_charts_for_period( - user, "album", year=year, month=month, week=week, day=day, limit=20 + user, "album", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "track": list( self.get_charts_for_period( - user, "track", year=year, month=month, week=week, day=day, limit=20 + user, "track", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "tv_series": list( self.get_charts_for_period( - user, "tv_series", year=year, month=month, week=week, day=day, limit=20 + user, "tv_series", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "video": list( self.get_charts_for_period( - user, "video", year=year, month=month, week=week, day=day, limit=20 + user, "video", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "board_game": list( self.get_charts_for_period( - user, "board_game", year=year, month=month, week=week, day=day, limit=20 + user, "board_game", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "book": list( self.get_charts_for_period( - user, "book", year=year, month=month, week=week, day=day, limit=20 + user, "book", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "food": list( self.get_charts_for_period( - user, "food", year=year, month=month, week=week, day=day, limit=20 + user, "food", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "podcast": list( self.get_charts_for_period( - user, "podcast", year=year, month=month, week=week, day=day, limit=20 + user, "podcast", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), "trail": list( self.get_charts_for_period( - user, "trail", year=year, month=month, week=week, day=day, limit=20 + user, "trail", year=list_year, month=list_month, week=list_week, day=list_day, limit=20 ) ), } diff --git a/vrobbler/templates/scrobbles/_top_charts.html b/vrobbler/templates/scrobbles/_top_charts.html index f3ca877..d2c1c37 100644 --- a/vrobbler/templates/scrobbles/_top_charts.html +++ b/vrobbler/templates/scrobbles/_top_charts.html @@ -97,7 +97,7 @@
-
#1 {{albums.0.album.title}}
+
#1 {{albums.0.album.name}}
{% if albums.0.album.cover_image %} {% else %} @@ -111,7 +111,7 @@ {% with albums|get_item:forloop.counter as album %} {% if album %}
-
#{{forloop.counter|add:1}} {{album.album.title}}
+
#{{forloop.counter|add:1}} {{album.album.name}}
{% if album.album.cover_image %} {% else %} @@ -130,7 +130,7 @@ {% with albums|get_item:idx as album %} {% if album %}
-
#{{forloop.counter|add:5}} {{album.album.title}}
+
#{{forloop.counter|add:5}} {{album.album.name}}
{% if album.album.cover_image %} {% else %}