From d79159670e1c674b626648d77b513b08eb480353 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 10 Mar 2023 11:30:23 -0500 Subject: [PATCH] Add chart view when not auth'd --- vrobbler/apps/scrobbles/views.py | 6 ++++-- vrobbler/templates/scrobbles/scrobble_list.html | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 53594f2..7a399bb 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -117,9 +117,11 @@ class RecentScrobbleList(ListView): "year": list(live_charts(**track, chart_period="year")), "all": list(live_charts(**track)), } + data["counts"] = scrobble_counts(user) + else: + data["weekly_data"] = week_of_scrobbles() + data["counts"] = scrobble_counts() - # data["weekly_data"] = week_of_scrobbles(user=user) - data["counts"] = scrobble_counts(user) data["imdb_form"] = ScrobbleForm data["export_form"] = ExportScrobbleForm return data diff --git a/vrobbler/templates/scrobbles/scrobble_list.html b/vrobbler/templates/scrobbles/scrobble_list.html index 895a517..03e7311 100644 --- a/vrobbler/templates/scrobbles/scrobble_list.html +++ b/vrobbler/templates/scrobbles/scrobble_list.html @@ -78,8 +78,9 @@ - {% if show_chart %} - + {% if not user.is_authenticated %} +

Today {{counts.today}} | This Week {{counts.week}} | This Month {{counts.month}} | This Year {{counts.year}} | All Time {{counts.alltime}}

+ {% endif %}
@@ -434,8 +435,7 @@

Last Scrobbles

-

Today {{counts.today}} | This Week {{counts.week}} | This Month {{counts.month}} | - This Year {{counts.year}} | All Time {{counts.alltime}}

+

Today {{counts.today}} | This Week {{counts.week}} | This Month {{counts.month}} | This Year {{counts.year}} | All Time {{counts.alltime}}