Repository navigation
feat: Add history scrobbling for the Plex source - #835
Draft
owendaprile wants to merge 5 commits into
Draft
owendaprile wants to merge 5 commits into
owendaprile wants to merge 5 commits into
Conversation
Retention cleanup didn't pass the component's ID to the play repository, so its query matched the plays of every source and client. A component with a shorter deleteAfter or compactAfter then deleted or compacted other components' plays, ignoring their own retention settings.
The ENV docs used devicesBlock's description for PLEX_DEVICES_ALLOW and devicesAllow's for PLEX_DEVICES_BLOCK, so each variable was documented as doing the opposite of what it does. The log messages for plays dropped by the user and device filters also started with a stray quote.
The Plex source polls the server's playback sessions, and Plex doesn't let a shared account read them. A shared account's own token gets 401 from the server, and the server token plex.tv issues it gets 403 for /status/sessions, so the source only works with the owner's token. The docs only said to find a Plex token.
Plexamp plays made offline never appear in Plex's sessions, so multi-scrobbler can't scrobble them. Plexamp uploads them to the server's play history when it reconnects, so the Plex source now checks that history at startup and every 15 minutes for plays that real-time tracking missed. History entries don't line up with tracked plays. Plex records an online play about halfway through and an offline play when it ends, and it can record one play several times or under another copy of the track. The shared duplicate check would treat these as separate plays, so the source matches each entry against its own saved plays by user, title, and time. Nothing else records which entries were handled, so the source only scrobbles entries recent enough that retention still keeps those plays. Closes FoxxMD#409.
👷 Deploy request for multi-scrobbler pending review.Visit the deploys page to approve it
|
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist before requesting a review
Type of change
Describe your changes
AI disclosure: The PR was mostly written by Claude Opus 5.5, and reviewed by Opus 5.5 and Fable 5.2. I manually reviewed it.
See #409 for background.
This PR adds backlog scrobbling for the Plex source (similar to Spotify). This mainly affects Plexamp downloads (or cached songs) played offline, which get uploaded when coming back online. It also catches plays made while MS or the Plex server were offline. I tested Plex Desktop (macOS) and it does not upload or scrobble plays made offline when coming back online.
The feature was developed and tested based on the following data from my Plex library and usage:
I also found during testing that the auth token needs to be the server owner’s for live-tracking to work at all. This likely applies to Plex Home accounts as well, but I didn’t test that. 69e3e64 adds a note about this to the docs.
I’m going to continue testing this PR against my Plex server and multiple clients, with different offline scenarios to make sure it works properly without scrobbling duplicates.
Known limits:
Open design questions: