From b98bb768b2a7f5f2bbb21c4762ede3db33db749c Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sun, 18 Apr 2021 11:36:43 -0400 Subject: [PATCH] fix for #208 --- modules/plex.py | 11 +++++++---- plex_meta_manager.py | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/plex.py b/modules/plex.py index e329df52..e8cfc7e4 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -203,16 +203,19 @@ class PlexAPI: item.addCollection(name) @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_failed) - def get_search_choices(self, search_name, key=False): + def get_search_choices(self, search_name): try: - if key: return {c.key.lower(): c.key for c in self.Plex.listFilterChoices(search_name)} - else: return {c.title.lower(): c.title for c in self.Plex.listFilterChoices(search_name)} + choices = {} + for choice in self.Plex.listFilterChoices(search_name): + choices[choice.title.lower()] = choice.title + choices[choice.key.lower()] = choice.title + return choices except NotFound: raise Failed(f"Collection Error: plex search attribute: {search_name} only supported with Plex's New TV Agent") def validate_search_list(self, data, search_name): final_search = search_translation[search_name] if search_name in search_translation else search_name - search_choices = self.get_search_choices(final_search, key=final_search.endswith("Language")) + search_choices = self.get_search_choices(final_search) valid_list = [] for value in util.get_list(data): if str(value).lower() in search_choices: diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 97c7e6fa..da8be078 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -89,7 +89,7 @@ util.centered("| |_) | |/ _ \\ \\/ / | |\\/| |/ _ \\ __/ _` | | |\\/| |/ _` | '_ util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | ") util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| ") util.centered(" |___/ ") -util.centered(" Version: 1.7.2-Beta2 ") +util.centered(" Version: 1.7.2-Beta3 ") util.separator() if my_tests: