From 77362d320761697bd73dcbcdbe00d7fa70f4fbd4 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 17 Jan 2023 10:55:56 -0500 Subject: [PATCH] Fix scrobble spam from Jellyfin The issue here was that we update a Jellyfin scrobble to be complete when it hits a certain threshold of percentage played (90) and then we stop finding that scrobble while the video finishes playing. This happens over and over again, so once a video reaches 90 percent played we get dozens more scrobbles for each update as the video finishes playing. This is a crude fix, for the spam, as we'll end up "resuming" videos that are stopped at 95 percent. So we need some way to mark the scrobble as complete. I think forcing the percent to 100 on finish might work. --- 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 9a6963c..ef9bf6e 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -83,12 +83,11 @@ class Scrobble(TimeStampedModel): cls.objects.filter( video=video, user_id=user_id, - played_to_completion=False, ) .order_by('-modified') .first() ) - if scrobble: + if scrobble and scrobble.playback_perecnt <= 100: logger.info( f"Found existing scrobble for video {video}, updating", {"scrobble_data": scrobble_data},