add show_options

pull/509/head
meisnate12 3 years ago
parent 355021f200
commit 03b02a2575

@ -178,6 +178,7 @@ class CollectionBuilder:
self.language = self.library.Plex.language
self.details = {
"show_filtered": self.library.show_filtered,
"show_options": self.library.show_options,
"show_missing": self.library.show_missing,
"save_missing": self.library.save_missing,
"missing_only_released": self.library.missing_only_released,
@ -538,7 +539,6 @@ class CollectionBuilder:
else:
raise Failed(f"{self.Type} Error: {self.data[methods['collection_level']]} collection_level invalid\n\tseason (Collection at the Season Level)\n\tepisode (Collection at the Episode Level)")
self.parts_collection = self.collection_level in ["season", "episode"]
self.media_type = self.collection_level.capitalize()
if "tmdb_person" in methods:
logger.debug("")
@ -1658,7 +1658,8 @@ class CollectionBuilder:
final_values.append(value)
else:
final_values = util.get_list(data)
search_choices = self.library.get_search_choices(attribute, title=not pairs)
use_title = not pairs
search_choices, names = self.library.get_search_choices(attribute, title=use_title)
valid_list = []
for value in final_values:
if str(value).lower() in search_choices:
@ -1668,6 +1669,8 @@ class CollectionBuilder:
valid_list.append(search_choices[str(value).lower()])
else:
error = f"Plex Error: {attribute}: {value} not found"
if self.details["show_options"]:
error += f"\nOptions: {names}"
if validate:
raise Failed(error)
else:

@ -229,6 +229,7 @@ class ConfigFile:
"only_filter_missing": check_for_attribute(self.data, "only_filter_missing", parent="settings", var_type="bool", default=False),
"show_unmanaged": check_for_attribute(self.data, "show_unmanaged", parent="settings", var_type="bool", default=True),
"show_filtered": check_for_attribute(self.data, "show_filtered", parent="settings", var_type="bool", default=False),
"show_options": check_for_attribute(self.data, "show_options", parent="settings", var_type="bool", default=False),
"show_missing": check_for_attribute(self.data, "show_missing", parent="settings", var_type="bool", default=True),
"show_missing_assets": check_for_attribute(self.data, "show_missing_assets", parent="settings", var_type="bool", default=True),
"save_missing": check_for_attribute(self.data, "save_missing", parent="settings", var_type="bool", default=True),
@ -442,6 +443,7 @@ class ConfigFile:
params["sync_mode"] = check_for_attribute(lib, "sync_mode", parent="settings", test_list=sync_modes, default=self.general["sync_mode"], do_print=False, save=False)
params["show_unmanaged"] = check_for_attribute(lib, "show_unmanaged", parent="settings", var_type="bool", default=self.general["show_unmanaged"], do_print=False, save=False)
params["show_filtered"] = check_for_attribute(lib, "show_filtered", parent="settings", var_type="bool", default=self.general["show_filtered"], do_print=False, save=False)
params["show_options"] = check_for_attribute(lib, "show_options", parent="settings", var_type="bool", default=self.general["show_options"], do_print=False, save=False)
params["show_missing"] = check_for_attribute(lib, "show_missing", parent="settings", var_type="bool", default=self.general["show_missing"], do_print=False, save=False)
params["show_missing_assets"] = check_for_attribute(lib, "show_missing_assets", parent="settings", var_type="bool", default=self.general["show_missing_assets"], do_print=False, save=False)
params["save_missing"] = check_for_attribute(lib, "save_missing", parent="settings", var_type="bool", default=self.general["save_missing"], do_print=False, save=False)

@ -50,6 +50,7 @@ class Library(ABC):
self.missing_only_released = params["missing_only_released"]
self.show_unmanaged = params["show_unmanaged"]
self.show_filtered = params["show_filtered"]
self.show_options = params["show_options"]
self.show_missing = params["show_missing"]
self.show_missing_assets = params["show_missing_assets"]
self.save_missing = params["save_missing"]

@ -376,11 +376,13 @@ class Plex(Library):
final_search = search_translation[search_name] if search_name in search_translation else search_name
final_search = show_translation[final_search] if self.is_show and final_search in show_translation else final_search
try:
names = []
choices = {}
for choice in self.Plex.listFilterChoices(final_search):
names.append(choice.title if title else choice.key)
choices[choice.title.lower()] = choice.title if title else choice.key
choices[choice.key.lower()] = choice.title if title else choice.key
return choices
return choices, names
except NotFound:
logger.debug(f"Search Attribute: {final_search}")
raise Failed(f"Plex Error: plex_search attribute: {search_name} not supported")

Loading…
Cancel
Save