diff --git a/VERSION b/VERSION index 099d276b..348a187c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.5-develop73 +1.16.5-develop74 diff --git a/docs/metadata/playlist.md b/docs/metadata/playlist.md index 732be9b2..fda9a22b 100644 --- a/docs/metadata/playlist.md +++ b/docs/metadata/playlist.md @@ -6,6 +6,8 @@ If utilized to their fullest, these files can be used to maintain the entire ser Playlists are defined in one or more Playlist files that are mapped in the [Playlist Files Attribute](../config/libraries.md#playlist-files-attribute) within the Configuration File. +You can use the [`playlist_report` setting](../config/settings.md#playlist-report) to get a list of your playlists printed out in your log. + These are the attributes which can be utilized within the Playlist File: | Attribute | Description | @@ -38,7 +40,7 @@ playlists: | Attribute | Description | Required | |:------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:| -| `libraries` | Determine which libraries the playlist will be built from.
**Options:** Comma-separated string or list of library mapping names defined in the `libraries` attribute. | ✅ | +| `libraries` | Determine which libraries the playlist will be built from.
**Options:** Comma-separated string or list of library mapping names defined in the `libraries` attribute in the base of your [Configuration File](../config/configuration). | ✅ | | `sync_to_users` | Determine which Users have the playlist synced.
This will override the global [`playlist_sync_to_users` Setting](../config/settings.md#playlist-sync-to-users).
**Options:** Comma-separated string or list of users, `all` for every user who has server access, or leave blank for just the server owner. | ❌ | | `delete_playlist` | Will delete this playlist for the users defined by sync_to_users.
**Options:** `true` or `false` | ❌ | diff --git a/modules/builder.py b/modules/builder.py index dc7edcb0..050822fa 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -315,6 +315,22 @@ class CollectionBuilder: self.sync_to_users = None self.valid_users = [] if self.playlist: + if "libraries" in methods: + logger.debug("") + logger.debug("Validating Method: libraries") + if not self.data[methods["libraries"]]: + raise Failed(f"{self.Type} Error: libraries attribute is blank") + else: + logger.debug(f"Value: {self.data[methods['libraries']]}") + for pl_library in util.get_list(self.data[methods["libraries"]]): + if str(pl_library) in config.library_map: + self.libraries.append(config.library_map[pl_library]) + else: + raise Failed(f"Playlist Error: Library: {pl_library} not defined") + self.library = self.libraries[0] + else: + raise Failed("Playlist Error: libraries attribute is required") + self.sync_to_users = config.general["playlist_sync_to_users"] if "sync_to_users" in methods or "sync_to_user" in methods: s_attr = f"sync_to_user{'s' if 'sync_to_users' in methods else ''}" @@ -346,22 +362,6 @@ class CollectionBuilder: if util.parse(self.Type, "delete_not_scheduled", self.data, datatype="bool", methods=methods, default=False): self.obj = self.library.get_playlist(self.name) logger.info(self.delete()) - - if "libraries" in methods: - logger.debug("") - logger.debug("Validating Method: libraries") - if not self.data[methods["libraries"]]: - raise Failed(f"{self.Type} Error: libraries attribute is blank") - else: - logger.debug(f"Value: {self.data[methods['libraries']]}") - for pl_library in util.get_list(self.data[methods["libraries"]]): - if str(pl_library) in config.library_map: - self.libraries.append(config.library_map[pl_library]) - else: - raise Failed(f"Playlist Error: Library: {pl_library} not defined") - self.library = self.libraries[0] - else: - raise Failed("Playlist Error: libraries attribute is required") else: self.libraries.append(self.library) diff --git a/modules/plex.py b/modules/plex.py index 5fdec8b0..de32717e 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -516,9 +516,7 @@ class Plex(Library): @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) def collection_mode_query(self, collection, data): - if int(collection.collectionMode) not in collection_mode_keys or collection_mode_keys[int(collection.collectionMode)] != data: - collection.modeUpdate(mode=data) - logger.info(f"Collection Mode | {data}") + collection.modeUpdate(mode=data) @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) def collection_order_query(self, collection, data):