From 8dc4988255ea896b1be7dae99db5fa6522c25891 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sun, 27 Mar 2022 16:59:14 -0400 Subject: [PATCH] [36] level fix for sort --- VERSION | 2 +- modules/builder.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index ce1755ee..6dc0611a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.2-develop35 +1.16.2-develop36 diff --git a/modules/builder.py b/modules/builder.py index 58dcc716..79731417 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -2563,8 +2563,13 @@ class CollectionBuilder: if self.custom_sort is True: items = self.added_items else: - collection_type = f"{self.collection_level}_collection" if self.collection_level in ["season", "episode"] else "collection" - search_data = self.build_filter("plex_search", {"sort_by": self.custom_sort, "any": {collection_type: self.name}}) + plex_search = {"sort_by": self.custom_sort} + if self.collection_level in ["season", "episode"]: + plex_search["type"] = f"{self.collection_level}s" + plex_search["any"] = {f"{self.collection_level}_collection": self.name} + else: + plex_search["any"] = {"collection": self.name} + search_data = self.build_filter("plex_search", plex_search) items = self.library.get_filter_items(search_data[2]) previous = None for item in items: