|
|
@ -478,7 +478,7 @@ class PlexAPI:
|
|
|
|
smart_filter = self.get_collection(collection)._data.attrib.get('content')
|
|
|
|
smart_filter = self.get_collection(collection)._data.attrib.get('content')
|
|
|
|
return smart_filter[smart_filter.index("?"):]
|
|
|
|
return smart_filter[smart_filter.index("?"):]
|
|
|
|
|
|
|
|
|
|
|
|
def validate_search_list(self, data, search_name, title=True, pairs=False, fail=True):
|
|
|
|
def validate_search_list(self, data, search_name, title=True, pairs=False):
|
|
|
|
final_search = search_translation[search_name] if search_name in search_translation else 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, title=title)
|
|
|
|
search_choices = self.get_search_choices(final_search, title=title)
|
|
|
|
valid_list = []
|
|
|
|
valid_list = []
|
|
|
@ -488,10 +488,8 @@ class PlexAPI:
|
|
|
|
valid_list.append((value, search_choices[str(value).lower()]))
|
|
|
|
valid_list.append((value, search_choices[str(value).lower()]))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
valid_list.append(search_choices[str(value).lower()])
|
|
|
|
valid_list.append(search_choices[str(value).lower()])
|
|
|
|
elif fail:
|
|
|
|
|
|
|
|
raise Failed(f"Plex Error: {search_name}: {value} not found")
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
logger.error(f"Plex Error: {search_name}: {value} not found")
|
|
|
|
raise Failed(f"Plex Error: {search_name}: {value} not found")
|
|
|
|
return valid_list
|
|
|
|
return valid_list
|
|
|
|
|
|
|
|
|
|
|
|
def get_collection(self, data):
|
|
|
|
def get_collection(self, data):
|
|
|
|