Fix bug in duplicate lastfm scrobbles

This commit is contained in:
2023-02-15 01:41:10 -05:00
parent 20528b576b
commit c7b84b27b2

View File

@ -69,11 +69,11 @@ class LastFM:
in_progress=False, in_progress=False,
) )
# Vrobbler scrobbles on finish, LastFM scrobbles on start # Vrobbler scrobbles on finish, LastFM scrobbles on start
ten_seconds_eariler = timestamp - timedelta(seconds=15) seconds_eariler = timestamp - timedelta(seconds=20)
ten_seconds_later = timestamp + timedelta(seconds=15) seconds_later = timestamp + timedelta(seconds=20)
existing = Scrobble.objects.filter( existing = Scrobble.objects.filter(
timestamp__gte=ten_seconds_eariler, created__gte=seconds_eariler,
timestamp__lte=ten_seconds_later, created__lte=seconds_later,
track=track, track=track,
).first() ).first()
if existing: if existing: