From e0505cb82cfcf2a30a0f5eab98db808c25d0aee5 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 21 Jun 2026 22:36:58 -0400 Subject: [PATCH] [templates] Fix caching issue with Now Playing --- vrobbler/apps/scrobbles/context_processors.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/vrobbler/apps/scrobbles/context_processors.py b/vrobbler/apps/scrobbles/context_processors.py index fa9a642..50ce86f 100644 --- a/vrobbler/apps/scrobbles/context_processors.py +++ b/vrobbler/apps/scrobbles/context_processors.py @@ -1,5 +1,4 @@ import pytz -from django.core.cache import cache from django.utils import timezone from scrobbles.constants import EXCLUDE_FROM_NOW_PLAYING @@ -20,8 +19,6 @@ MONTH_COLORS = [ "#db7a7a", # Dec ] -CACHE_TTL = 60 - def month_color(request): from datetime import date @@ -33,10 +30,8 @@ def now_playing(request): if not user.is_authenticated: return {} - cache_key = f"now_playing_list_{user.id}" - now_playing_list = cache.get(cache_key) - if now_playing_list is None: - now_playing_list = list( + return { + "now_playing_list": list( Scrobble.objects.filter( in_progress=True, is_paused=False, @@ -46,9 +41,5 @@ def now_playing(request): media_type__in=EXCLUDE_FROM_NOW_PLAYING, ) .select_related("track", "video", "podcast_episode") - ) - cache.set(cache_key, now_playing_list, CACHE_TTL) - - return { - "now_playing_list": now_playing_list, + ), }