From aae2dd75678e35b6dfb829b614edd81faea3c80b Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 26 Nov 2023 11:12:48 +0100 Subject: [PATCH] Exclude geo locs from now playing --- vrobbler/apps/scrobbles/constants.py | 4 ++++ vrobbler/apps/scrobbles/context_processors.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/vrobbler/apps/scrobbles/constants.py b/vrobbler/apps/scrobbles/constants.py index 29b3e21..fa65950 100644 --- a/vrobbler/apps/scrobbles/constants.py +++ b/vrobbler/apps/scrobbles/constants.py @@ -8,6 +8,10 @@ LONG_PLAY_MEDIA = { "books": "Book", } +EXCLUDE_FROM_NOW_PLAYING = ( + "GeoLocation", +) + MANUAL_SCROBBLE_FNS = { "-v": "manual_scrobble_video_game", "-b": "manual_scrobble_book", diff --git a/vrobbler/apps/scrobbles/context_processors.py b/vrobbler/apps/scrobbles/context_processors.py index 86dba18..727fd51 100644 --- a/vrobbler/apps/scrobbles/context_processors.py +++ b/vrobbler/apps/scrobbles/context_processors.py @@ -1,7 +1,8 @@ import pytz from django.utils import timezone -from scrobbles.models import Scrobble +from scrobbles.constants import EXCLUDE_FROM_NOW_PLAYING +from scrobbles.models import Scrobble def now_playing(request): user = request.user @@ -13,5 +14,7 @@ def now_playing(request): in_progress=True, is_paused=False, user=user, + ).exclude( + media_type__in=EXCLUDE_FROM_NOW_PLAYING, ) }