فهرست منبع

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.
Colin Powell 2 سال پیش
والد
کامیت
77362d3207
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      vrobbler/apps/scrobbles/models.py

+ 1 - 2
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},