From bf9a6a9679e1c96fd1b92497f992aaeb8e70a80a Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 9 Jun 2026 22:08:15 -0400 Subject: [PATCH] [charts] Fix only seeing first top media instance --- PROJECT.org | 6 +++++- vrobbler/apps/charts/templatetags/chart_tags.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/PROJECT.org b/PROJECT.org index 848c015..27b5866 100644 --- a/PROJECT.org +++ b/PROJECT.org @@ -88,7 +88,7 @@ fetching and simple saving. *** Metadata sources **** Scraper -* Backlog [0/15] :vrobbler:project:personal: +* Backlog [1/16] :vrobbler:project:personal: ** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :vrobbler:personal:bug:music:scrobbles: :PROPERTIES: :ID: 702462cf-d54b-48c6-8a7c-78b8de751deb @@ -544,6 +544,10 @@ log a warning and move on. We should have a global view `/favorites/` that shows the logged in users's favorited media objects. +** DONE [#B] Fix bug in charts where only #1 is displayed :charts:templates: +:PROPERTIES: +:ID: 7136dffb-e6b7-184b-48ac-bb09bae0b0f0 +:END: * Version 50.0 [2/2] ** DONE [#A] Allow updating all a user's scrobble visibility at once :scrobbles:sharing:feature: :PROPERTIES: diff --git a/vrobbler/apps/charts/templatetags/chart_tags.py b/vrobbler/apps/charts/templatetags/chart_tags.py index b726fb3..7b184d4 100644 --- a/vrobbler/apps/charts/templatetags/chart_tags.py +++ b/vrobbler/apps/charts/templatetags/chart_tags.py @@ -7,7 +7,10 @@ register = template.Library() def get_item(dictionary, key): if isinstance(dictionary, dict): return dictionary.get(key) - return None + try: + return dictionary[int(key)] + except (IndexError, KeyError, TypeError, ValueError): + return None @register.filter