From df6a16f1e7d993a528890dfa6a019281182971e4 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 1 May 2026 21:08:44 -0400 Subject: [PATCH] [location] Fix scrobble time --- .../scrobbles/management/commands/fix_playback_position.py | 6 ++---- vrobbler/apps/scrobbles/scrobblers.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/vrobbler/apps/scrobbles/management/commands/fix_playback_position.py b/vrobbler/apps/scrobbles/management/commands/fix_playback_position.py index 8ba8391..2557a84 100644 --- a/vrobbler/apps/scrobbles/management/commands/fix_playback_position.py +++ b/vrobbler/apps/scrobbles/management/commands/fix_playback_position.py @@ -3,7 +3,7 @@ from datetime import timedelta from django.core.management.base import BaseCommand from django.db.models import F, Q -from vrobbler.apps.scrobbles.models import Scrobble +from scrobbles.models import Scrobble class Command(BaseCommand): @@ -64,6 +64,4 @@ class Command(BaseCommand): ) ) else: - self.stdout.write( - self.style.SUCCESS(f"Updated {updated} scrobbles") - ) + self.stdout.write(self.style.SUCCESS(f"Updated {updated} scrobbles")) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index 2feaae3..9d19854 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -1081,7 +1081,7 @@ def gpslogger_scrobble_location(data_dict: dict, user_id: int) -> Scrobble: "position_provider": provider, } ) - if scrobble.timestamp: + if scrobble.in_progress and scrobble.timestamp: scrobble.playback_position_seconds = ( timezone.now() - scrobble.timestamp ).seconds