From c7b84b27b2450822bcfbce21e46e3658791c4b1c Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 15 Feb 2023 01:41:10 -0500 Subject: [PATCH] Fix bug in duplicate lastfm scrobbles --- vrobbler/apps/scrobbles/lastfm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vrobbler/apps/scrobbles/lastfm.py b/vrobbler/apps/scrobbles/lastfm.py index cc4758e..1c48aff 100644 --- a/vrobbler/apps/scrobbles/lastfm.py +++ b/vrobbler/apps/scrobbles/lastfm.py @@ -69,11 +69,11 @@ class LastFM: in_progress=False, ) # Vrobbler scrobbles on finish, LastFM scrobbles on start - ten_seconds_eariler = timestamp - timedelta(seconds=15) - ten_seconds_later = timestamp + timedelta(seconds=15) + seconds_eariler = timestamp - timedelta(seconds=20) + seconds_later = timestamp + timedelta(seconds=20) existing = Scrobble.objects.filter( - timestamp__gte=ten_seconds_eariler, - timestamp__lte=ten_seconds_later, + created__gte=seconds_eariler, + created__lte=seconds_later, track=track, ).first() if existing: