[45] fix plex_search season sort

pull/858/head
meisnate12 3 years ago
parent e2393da47e
commit cd351107e9

@ -1 +1 @@
1.16.5-develop44 1.16.5-develop45

@ -1235,7 +1235,7 @@ class CollectionBuilder:
new_dictionary = {} new_dictionary = {}
if method_name == "plex_search": if method_name == "plex_search":
type_override = f"{self.collection_level}s" if self.collection_level in plex.collection_level_options else None type_override = f"{self.collection_level}s" if self.collection_level in plex.collection_level_options else None
new_dictionary = self.build_filter("plex_search", dict_data, type_override=type_override, default_sort="season.asc" if self.collection_level == "season" else "title.asc") new_dictionary = self.build_filter("plex_search", dict_data, type_override=type_override)
elif method_name == "plex_collectionless": elif method_name == "plex_collectionless":
prefix_list = util.parse(self.Type, "exclude_prefix", dict_data, datatype="list", methods=dict_methods) if "exclude_prefix" in dict_methods else [] prefix_list = util.parse(self.Type, "exclude_prefix", dict_data, datatype="list", methods=dict_methods) if "exclude_prefix" in dict_methods else []
exact_list = util.parse(self.Type, "exclude", dict_data, datatype="list", methods=dict_methods) if "exclude" in dict_methods else [] exact_list = util.parse(self.Type, "exclude", dict_data, datatype="list", methods=dict_methods) if "exclude" in dict_methods else []
@ -1652,7 +1652,7 @@ class CollectionBuilder:
if self.details["show_filtered"] is True: if self.details["show_filtered"] is True:
logger.info(f"{name} {self.Type} | X | {current_title}") logger.info(f"{name} {self.Type} | X | {current_title}")
def build_filter(self, method, plex_filter, display=False, default_sort="title.asc", type_override=None): def build_filter(self, method, plex_filter, display=False, default_sort=None, type_override=None):
if display: if display:
logger.info("") logger.info("")
logger.info(f"Validating Method: {method}") logger.info(f"Validating Method: {method}")
@ -1686,9 +1686,9 @@ class CollectionBuilder:
sort_type = "movies" sort_type = "movies"
ms = method.split("_") ms = method.split("_")
filter_details = f"{ms[0].capitalize()} {sort_type.capitalize()[:-1]} {ms[1].capitalize()}\n" filter_details = f"{ms[0].capitalize()} {sort_type.capitalize()[:-1]} {ms[1].capitalize()}\n"
type_key, sorts = plex.sort_types[sort_type] type_default_sort, type_key, sorts = plex.sort_types[sort_type]
sort = default_sort sort = default_sort if default_sort else type_default_sort
if "sort_by" in filter_alias: if "sort_by" in filter_alias:
if plex_filter[filter_alias["sort_by"]] is None: if plex_filter[filter_alias["sort_by"]] is None:
raise Failed(f"{self.Type} Error: sort_by attribute is blank") raise Failed(f"{self.Type} Error: sort_by attribute is blank")

@ -373,13 +373,13 @@ track_sorts = {
"random": "random" "random": "random"
} }
sort_types = { sort_types = {
"movies": (1, movie_sorts), "movies": ("title.asc", 1, movie_sorts),
"shows": (2, show_sorts), "shows": ("title.asc", 2, show_sorts),
"seasons": (3, season_sorts), "seasons": ("season.asc", 3, season_sorts),
"episodes": (4, episode_sorts), "episodes": ("title.asc", 4, episode_sorts),
"artists": (8, artist_sorts), "artists": ("title.asc", 8, artist_sorts),
"albums": (9, album_sorts), "albums": ("title.asc", 9, album_sorts),
"tracks": (10, track_sorts) "tracks": ("title.asc", 10, track_sorts)
} }
class Plex(Library): class Plex(Library):

Loading…
Cancel
Save