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,