[charts] Fix bug where chart updates firing on wrong media types
This commit is contained in:
@ -92,7 +92,7 @@ fetching and simple saving.
|
|||||||
:LOGBOOK:
|
:LOGBOOK:
|
||||||
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
|
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
|
||||||
:END:
|
: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] 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:
|
** TODO [#C] Move to using more robust mopidy-webhooks pacakge form pypi :utility:improvement:
|
||||||
:PROPERTIES:
|
: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 [#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:
|
** 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:
|
** DONE Fix uniqueness of imdb_id messing up youtube videos :vrobbler:project:bug:videos:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 610b8c4c-abf1-8630-a4fd-08d9939da9f5
|
:ID: 610b8c4c-abf1-8630-a4fd-08d9939da9f5
|
||||||
|
|||||||
@ -5,7 +5,7 @@ from django.dispatch import receiver
|
|||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from scrobbles.models import Scrobble
|
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__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -18,6 +18,9 @@ def update_charts_on_scrobble_complete(sender, instance, **kwargs):
|
|||||||
if instance.timestamp is None:
|
if instance.timestamp is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if instance.media_type not in MEDIA_TYPES:
|
||||||
|
return
|
||||||
|
|
||||||
_update_charts_for_timestamp(instance.user, instance.timestamp)
|
_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:
|
if instance.timestamp is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if instance.media_type not in MEDIA_TYPES:
|
||||||
|
return
|
||||||
|
|
||||||
_update_charts_for_timestamp(instance.user, instance.timestamp)
|
_update_charts_for_timestamp(instance.user, instance.timestamp)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user