From 2536e330af40f3f6b0b5512d6aa4a7543642a6a2 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 5 Jun 2026 13:41:30 -0400 Subject: [PATCH] [tracks] Use todays date for creating monthly playlists --- vrobbler/apps/scrobbles/utils.py | 3 ++- vrobbler/apps/scrobbles/views.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vrobbler/apps/scrobbles/utils.py b/vrobbler/apps/scrobbles/utils.py index ee316b6..2f23bba 100644 --- a/vrobbler/apps/scrobbles/utils.py +++ b/vrobbler/apps/scrobbles/utils.py @@ -659,7 +659,8 @@ def add_track_to_mopidy_monthly_playlist(scrobble): if not mopidy_uri: return - playlist_name = DateFormat(scrobble.timestamp).format(pattern) + now = now_user_timezone(profile) + playlist_name = DateFormat(now).format(pattern) if not playlist_name: return diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 29d6f4f..8310f2e 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -35,6 +35,7 @@ from django.http import ( from django.shortcuts import get_object_or_404, redirect from django.urls import reverse_lazy from django.utils import timezone +from django.utils.dateformat import DateFormat from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django.views.generic import DetailView, FormView, TemplateView @@ -1051,13 +1052,12 @@ def add_to_mopidy_monthly_playlist(request, uuid): ) return redirect("scrobbles:detail", uuid=uuid) + now = now_user_timezone(profile) + playlist_name = DateFormat(now).format(pattern) + from scrobbles.utils import add_track_to_mopidy_monthly_playlist add_track_to_mopidy_monthly_playlist(scrobble) - - from django.utils.dateformat import DateFormat - - playlist_name = DateFormat(scrobble.timestamp).format(pattern) messages.add_message( request, messages.SUCCESS,