[location] Fix scrobble time
All checks were successful
build & deploy / test (push) Successful in 1m56s
build & deploy / build-and-deploy (push) Successful in 30s

This commit is contained in:
2026-05-01 21:08:44 -04:00
parent 752b4afaa9
commit df6a16f1e7
2 changed files with 3 additions and 5 deletions

View File

@ -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"))

View File

@ -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