[20] fix playlist plex_searches

pull/1024/head
meisnate12 2 years ago
parent 976a27d6b7
commit 4922651b5f

@ -1 +1 @@
1.17.3-develop19
1.17.3-develop20

@ -113,6 +113,7 @@ There are a couple other attributes you can have at the top level only along wit
|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `limit` | **Description:** The max number of item for the search.<br>**Default:** `all`<br>**Values:** `all` or a number greater than 0 |
| `sort_by` | **Description:** This will control how the filter is sorted in your library.<br>**Default:** `random`<br>**Values:** Any sort options for your search type in the [Sorts Options Table](#sort-options) |
| `type` | **PLAYLIST SEARCHES ONLY** **Description:** Allows different types of media to be searched for.<br>**Default:** `movie`, `show`, or `artist` depending on library type<br>**Values:** `movie`, `show`, `season`, `episode`, `artist`, `album` or `track`
| `validate` | **Description:** Determines if a collection/playlist will fail on a validation error<br>**Default:** `true`<br>**Values**: `true` or `false` |
## Sort Options

@ -1747,7 +1747,13 @@ class CollectionBuilder:
raise Failed(f"{self.Type} Error: Cannot have more then one base")
if self.builder_level == "item":
if self.library.is_show:
if "type" in filter_alias:
if plex_filter[filter_alias["type"]] is None:
raise Failed(f"{self.Type} Error: type attribute is blank")
if plex_filter[filter_alias["type"]] not in plex.sort_types:
raise Failed(f"{self.Type} Error: type: {plex_filter[filter_alias['type']]} is invalid. Options: {', '.join(plex.sort_types)}")
sort_type = plex_filter[filter_alias["type"]]
elif self.library.is_show:
sort_type = "show"
elif self.library.is_music:
sort_type = "artist"

@ -207,10 +207,10 @@ class Overlays:
if f"<<{format_var}" in full_text and format_var == "originally_available[":
mod = re.search("<<originally_available\\[(.+)]>>", full_text).group(1)
format_var = "originally_available"
elif f"<<{format_var}>>" in full_text and format_var.endswith((m for m in overlay.double_mods)):
elif f"<<{format_var}>>" in full_text and format_var.endswith(tuple(m for m in overlay.double_mods)):
mod = format_var[-2:]
format_var = format_var[:-2]
elif f"<<{format_var}>>" in full_text and format_var.endswith((m for m in overlay.single_mods)):
elif f"<<{format_var}>>" in full_text and format_var.endswith(tuple(m for m in overlay.single_mods)):
mod = format_var[-1]
format_var = format_var[:-1]
elif f"<<{format_var}>>" in full_text:

Loading…
Cancel
Save