[location] Fix scrobble time
This commit is contained in:
@ -3,7 +3,7 @@ from datetime import timedelta
|
|||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.db.models import F, Q
|
from django.db.models import F, Q
|
||||||
|
|
||||||
from vrobbler.apps.scrobbles.models import Scrobble
|
from scrobbles.models import Scrobble
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@ -64,6 +64,4 @@ class Command(BaseCommand):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.stdout.write(
|
self.stdout.write(self.style.SUCCESS(f"Updated {updated} scrobbles"))
|
||||||
self.style.SUCCESS(f"Updated {updated} scrobbles")
|
|
||||||
)
|
|
||||||
|
|||||||
@ -1081,7 +1081,7 @@ def gpslogger_scrobble_location(data_dict: dict, user_id: int) -> Scrobble:
|
|||||||
"position_provider": provider,
|
"position_provider": provider,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if scrobble.timestamp:
|
if scrobble.in_progress and scrobble.timestamp:
|
||||||
scrobble.playback_position_seconds = (
|
scrobble.playback_position_seconds = (
|
||||||
timezone.now() - scrobble.timestamp
|
timezone.now() - scrobble.timestamp
|
||||||
).seconds
|
).seconds
|
||||||
|
|||||||
Reference in New Issue
Block a user