[charts] Fix bug where chart updates firing on wrong media types
Some checks failed
build & deploy / test (push) Successful in 1m41s
build & deploy / deploy (push) Failing after 2m3s

This commit is contained in:
2026-03-23 19:26:34 -04:00
parent 21355bae41
commit 1ea29fee1b
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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)