From 1ea29fee1b6453cba6d63f37f797dd445d9330ca Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 23 Mar 2026 19:26:34 -0400 Subject: [PATCH] [charts] Fix bug where chart updates firing on wrong media types --- PROJECT.org | 7 ++++++- vrobbler/apps/scrobbles/signals.py | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/PROJECT.org b/PROJECT.org index 13a1bd8..030060a 100644 --- a/PROJECT.org +++ b/PROJECT.org @@ -92,7 +92,7 @@ fetching and simple saving. :LOGBOOK: CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20 :END: -* Backlog [15/34] +* Backlog [16/35] ** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :vrobbler:personal:bug:music:scrobbles: ** TODO [#C] Move to using more robust mopidy-webhooks pacakge form pypi :utility:improvement: :PROPERTIES: @@ -431,6 +431,11 @@ https://app.todoist.com/app/task/add-a-csv-endpoint-for-users-book-reads-that-li ** TODO [#A] When creating org-mode tasks, don't copy comments :vrobbler:bug:scrobbles:tasks: ** TODO Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment: +** DONE Fix genearting chart records :vrobbler:bug:personal:project:chartrecords: +:PROPERTIES: +:ID: e749d762-44ac-dd7e-017e-2423016737ff +:END: + ** DONE Fix uniqueness of imdb_id messing up youtube videos :vrobbler:project:bug:videos: :PROPERTIES: :ID: 610b8c4c-abf1-8630-a4fd-08d9939da9f5 diff --git a/vrobbler/apps/scrobbles/signals.py b/vrobbler/apps/scrobbles/signals.py index 7735b4c..df87b3f 100644 --- a/vrobbler/apps/scrobbles/signals.py +++ b/vrobbler/apps/scrobbles/signals.py @@ -5,7 +5,7 @@ from django.dispatch import receiver from django.utils import timezone from scrobbles.models import Scrobble -from scrobbles.tasks import update_charts_for_timestamp +from scrobbles.tasks import MEDIA_TYPES, update_charts_for_timestamp logger = logging.getLogger(__name__) @@ -18,6 +18,9 @@ def update_charts_on_scrobble_complete(sender, instance, **kwargs): if instance.timestamp is None: return + if instance.media_type not in MEDIA_TYPES: + return + _update_charts_for_timestamp(instance.user, instance.timestamp) @@ -26,6 +29,9 @@ def update_charts_on_scrobble_delete(sender, instance, **kwargs): if instance.timestamp is None: return + if instance.media_type not in MEDIA_TYPES: + return + _update_charts_for_timestamp(instance.user, instance.timestamp)