Add support for multiple music libraries, and libraries not named 'Music' #2
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.
PR: Support Multiple Music Libraries in PlexService
Problem
The current implementation of
PlexServiceassumes there's a single music library named "Music" in the Plex server. This causes the application to fail when a user has multiple music libraries or has named their music library something other than "Music".I've also taken the opportunity to add some sections to the README, mainly;
make startcommand.latestunless itsmaster, as its handy for running pre-release images on forked repos that are pending PR approval/merge.Solution
This PR modifies the
PlexServiceclass to handle multiple music libraries by:Changes
self._music_librarytoself._music_libraries(a list instead of a single library)initializemethod to find all music libraries by checking for sections with type 'artist'get_artists_albums_bulkmethod to search for artists across all music librariescreate_curated_playlistmethod to search for artists and tracks across all music librariesTesting
Benefits