From 41570dc2f92916913eea996ac6ea359144bdb237 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 30 Jan 2023 18:25:27 -0500 Subject: [PATCH] Fix duplicate Jellyfin music scrobbling bug Solution is identical to what we were already doing with videos. When looking for existing scrobbles, don't filter by completion, but just check if the scrobble was played to completion. This does create another irritating situation where old scrobbles from days, months or even years ago that were not played to completion will be resurrected and made current here. But that's way less annoying than having spam scrobbles at the end of every track. --- vrobbler/apps/scrobbles/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index 2773ed8..0334201 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -133,12 +133,11 @@ class Scrobble(TimeStampedModel): cls.objects.filter( track=track, user_id=user_id, - played_to_completion=False, ) .order_by('-modified') .first() ) - if scrobble: + if scrobble and scrobble.percent_played <= 100: logger.debug( f"Found existing scrobble for track {track}, updating", {"scrobble_data": scrobble_data},