Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plex): Initial Plex API Source implementation #211

Merged
merged 8 commits into from
Oct 24, 2024
Merged

feat(plex): Initial Plex API Source implementation #211

merged 8 commits into from
Oct 24, 2024

Conversation

FoxxMD
Copy link
Owner

@FoxxMD FoxxMD commented Oct 22, 2024

Checklist before requesting a review

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Describe your changes

Implements a Source for Plex using the official API. This source will eventually replace the existing webhook Source.

Find a Plex Token for the Plex server and note the URL:PORT to use with it.

Example file config

Example ENV config

Environmental Variable Required? Default Description
PLEX_URL Yes The URL of the Plex server IE http://localhost:32400
PLEX_TOKEN Yes The Plex Token to use with the API
PLEX_USERS_ALLOW No Comma-separated list of usernames (from Plex) to scrobble for
PLEX_USERS_BLOCK No Comma-separated list of usernames (from Plex) to disallow scrobble for
PLEX_DEVICES_ALLOW No Comma-separated list of devices to scrobble from
PLEX_DEVICES_BLOCK No Comma-separated list of devices to disallow scrobbles from
PLEX_LIBRARIES_ALLOW No Comma-separated list of libraries to allow scrobbles from
PLEX_LIBRARIES_BLOCK No Comma-separated list of libraries to disallow scrobbles from

#95

@FoxxMD FoxxMD added the safe to test trusted to build image label Oct 22, 2024
@FoxxMD FoxxMD self-assigned this Oct 22, 2024
@FoxxMD
Copy link
Owner Author

FoxxMD commented Oct 22, 2024

Due to an issue with the underlying plex api library MS cannot currently retrieve the "friendly" username of the user providing the Plex Token and so cannot determine which users should be allowed automatically.

For now users need to provide usersAllow or PLEX_USERS_ALLOW in order to scrobble anything.

EDIT: Was able to workaround this by using response raw value

Ignore sdk validation error and get raw value in order to parse authenticated user
…e based on Source behavior

Plex only updates player position every 15 seconds (of played track) so player state needs to be adapted to not detect this as a pause or seek.

* Allow per-source drift allowed before triggering seek
* Allow per-source pause detection
Copy link
Contributor

📦 A new release has been made for this pull request.

To play around with this PR, pull an image:

  • foxxmd/multi-scrobbler:pr-211

Images are available for x86_64 and ARM64.

Latest commit: 3cc735b

@FoxxMD FoxxMD merged commit da76945 into master Oct 24, 2024
2 of 4 checks passed
@FoxxMD FoxxMD deleted the plexApi branch October 24, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test trusted to build image
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant