removed uneeded crew and plex_collection

pull/240/head
meisnate12 4 years ago
parent 380ab73f52
commit fae06ce8c0

@ -14,6 +14,7 @@ advance_new_agent = ["item_metadata_language", "item_use_original_title"]
advance_show = ["item_episode_sorting", "item_keep_episodes", "item_delete_episodes", "item_season_display", "item_episode_sorting"] advance_show = ["item_episode_sorting", "item_keep_episodes", "item_delete_episodes", "item_season_display", "item_episode_sorting"]
method_alias = { method_alias = {
"actors": "actor", "role": "actor", "roles": "actor", "actors": "actor", "role": "actor", "roles": "actor",
"collections": "collecion", "plex_collection": "collection",
"content_ratings": "content_rating", "contentRating": "content_rating", "contentRatings": "content_rating", "content_ratings": "content_rating", "contentRating": "content_rating", "contentRatings": "content_rating",
"countries": "country", "countries": "country",
"decades": "decade", "decades": "decade",
@ -557,18 +558,6 @@ class CollectionBuilder:
else: else:
smart_values = util.get_list(smart_data) smart_values = util.get_list(smart_data)
results_list = [] results_list = []
if smart == "crew":
for c_type in ["actor", "director", "producer", "writer"]:
try:
results_list.extend(self.library.validate_search_list(smart_values, c_type, title=False, pairs=True))
except Failed as e:
logger.error(e)
if len(results_list) == 0:
if fail:
raise Failed(f"Plex Error: crew: {final_values} not found")
else:
logger.error(f"Plex Error: crew: {final_values} not found")
else:
try: try:
results_list = self.library.validate_search_list(smart_values, smart, title=False, pairs=True) results_list = self.library.validate_search_list(smart_values, smart, title=False, pairs=True)
except Failed as e: except Failed as e:
@ -803,24 +792,10 @@ class CollectionBuilder:
final_values.append(value) final_values.append(value)
else: else:
final_values = method_data final_values = method_data
search = os.path.splitext(method_name)[0] search = self.library.validate_search_list(final_values, os.path.splitext(method_name)[0])
if search == "crew": self.methods.append(("plex_search", [{method_name: search}]))
valid_methods = []
for crew_type in ["actor", "director", "producer", "writer"]:
try:
valid_methods.append(("plex_search", [{crew_type: self.library.validate_search_list(final_values, crew_type)}]))
except Failed as e:
logger.error(e)
if len(valid_methods) > 0:
self.methods.extend(valid_methods)
else:
raise Failed(f"Plex Error: crew: {method_data} not found")
else:
self.methods.append(("plex_search", [{method_name: self.library.validate_search_list(final_values, search)}]))
elif method_name == "plex_all": elif method_name == "plex_all":
self.methods.append((method_name, [""])) self.methods.append((method_name, [""]))
elif method_name == "plex_collection":
self.methods.append((method_name, self.library.validate_collections(method_data if isinstance(method_data, list) else [method_data])))
elif method_name == "anidb_popular": elif method_name == "anidb_popular":
list_count = util.regex_first_int(method_data, "List Size", default=40) list_count = util.regex_first_int(method_data, "List Size", default=40)
if 1 <= list_count <= 30: if 1 <= list_count <= 30:
@ -983,20 +958,6 @@ class CollectionBuilder:
final_values.append(value) final_values.append(value)
else: else:
final_values = util.get_list(search_data) final_values = util.get_list(search_data)
if search == "crew":
valid_methods = []
for crew_type in ["actor", "director", "producer", "writer"]:
try:
valid_methods.append(("plex_search", [{crew_type: self.library.validate_search_list(final_values, crew_type)}]))
except Failed as e:
logger.error(e)
if len(valid_methods) > 0:
self.methods.extend(valid_methods)
elif validate:
raise Failed(f"Plex Error: crew: {final_values} not found")
else:
logger.error(f"Plex Error: crew: {final_values} not found")
else:
try: try:
searches[search_final] = self.library.validate_search_list(final_values, search) searches[search_final] = self.library.validate_search_list(final_values, search)
except Failed as e: except Failed as e:

@ -12,7 +12,7 @@ from urllib import parse
logger = logging.getLogger("Plex Meta Manager") logger = logging.getLogger("Plex Meta Manager")
builders = ["plex_all", "plex_collection", "plex_collectionless", "plex_search"] builders = ["plex_all", "plex_collectionless", "plex_search"]
search_translation = { search_translation = {
"audio_language": "audioLanguage", "audio_language": "audioLanguage",
"content_rating": "contentRating", "content_rating": "contentRating",
@ -81,7 +81,6 @@ searches = [
"actor", "actor.and", "actor.not", "actor", "actor.and", "actor.not",
"audio_language", "audio_language.and", "audio_language.not", "audio_language", "audio_language.and", "audio_language.not",
"collection", "collection.and", "collection.not", "collection", "collection.and", "collection.not",
"crew",
"content_rating", "content_rating.and", "content_rating.not", "content_rating", "content_rating.and", "content_rating.not",
"country", "country.and", "country.not", "country", "country.and", "country.not",
"director", "director.and", "director.not", "director", "director.and", "director.not",
@ -114,7 +113,6 @@ show_only_searches = [
] ]
tmdb_searches = [ tmdb_searches = [
"actor", "actor.and", "actor.not", "actor", "actor.and", "actor.not",
"crew",
"director", "director.and", "director.not", "director", "director.and", "director.not",
"producer", "producer.and", "producer.not", "producer", "producer.and", "producer.not",
"writer", "writer.and", "writer.not" "writer", "writer.and", "writer.not"
@ -158,7 +156,6 @@ tags = [
"collection", "collection",
"content_rating", "content_rating",
"country", "country",
"crew",
"director", "director",
"genre", "genre",
"label", "label",
@ -521,9 +518,6 @@ class PlexAPI:
if method == "plex_all": if method == "plex_all":
logger.info(f"Processing {pretty} {media_type}s") logger.info(f"Processing {pretty} {media_type}s")
items = self.get_all() items = self.get_all()
elif method == "plex_collection":
logger.info(f"Processing {pretty} {data}")
items = data.items()
elif method == "plex_search": elif method == "plex_search":
search_terms = {} search_terms = {}
has_processed = False has_processed = False

Loading…
Cancel
Save