#379 Added ignore_ids and ignore_imdb_ids

pull/487/head
meisnate12 3 years ago
parent e8341bf3d3
commit 27edb7627c

@ -87,7 +87,8 @@ ignored_details = [
"smart_filter", "smart_label", "smart_url", "run_again", "schedule", "sync_mode", "template", "test", "delete_not_scheduled", "smart_filter", "smart_label", "smart_url", "run_again", "schedule", "sync_mode", "template", "test", "delete_not_scheduled",
"tmdb_person", "build_collection", "collection_order", "collection_level", "validate_builders", "collection_name" "tmdb_person", "build_collection", "collection_order", "collection_level", "validate_builders", "collection_name"
] ]
details = ["server_preroll", "collection_changes_webhooks", "collection_mode", "collection_order", "collection_level", "collection_minimum", "label"] + boolean_details + string_details details = ["ignore_ids", "ignore_imdb_ids", "server_preroll", "collection_changes_webhooks", "collection_mode", "collection_order",
"collection_level", "collection_minimum", "label"] + boolean_details + string_details
collectionless_details = ["collection_order", "plex_collectionless", "label", "label_sync_mode", "test"] + \ collectionless_details = ["collection_order", "plex_collectionless", "label", "label_sync_mode", "test"] + \
poster_details + background_details + summary_details + string_details poster_details + background_details + summary_details + string_details
item_bool_details = ["item_assets", "revert_overlay", "item_lock_background", "item_lock_poster", "item_lock_title", "item_refresh"] item_bool_details = ["item_assets", "revert_overlay", "item_lock_background", "item_lock_poster", "item_lock_title", "item_refresh"]
@ -746,6 +747,10 @@ class CollectionBuilder:
self.minimum = util.parse(method_name, method_data, datatype="int", minimum=1) self.minimum = util.parse(method_name, method_data, datatype="int", minimum=1)
elif method_name == "server_preroll": elif method_name == "server_preroll":
self.server_preroll = util.parse(method_name, method_data) self.server_preroll = util.parse(method_name, method_data)
elif method_name == "ignore_ids":
self.ignore_ids = util.parse(method_name, method_data, datatype="intlist")
elif method_name == "ignore_imdb_ids":
self.ignore_imdb_ids = util.parse(method_name, method_data, datatype="intlist")
elif method_name == "label": elif method_name == "label":
if "label" in methods and "label.sync" in methods: if "label" in methods and "label.sync" in methods:
raise Failed("Collection Error: Cannot use label and label.sync together") raise Failed("Collection Error: Cannot use label and label.sync together")
@ -1236,6 +1241,7 @@ class CollectionBuilder:
if id_type == "ratingKey": if id_type == "ratingKey":
rating_keys.append(input_id) rating_keys.append(input_id)
elif id_type == "tmdb" and not self.parts_collection: elif id_type == "tmdb" and not self.parts_collection:
if input_id not in self.ignore_ids:
if input_id in self.library.movie_map: if input_id in self.library.movie_map:
rating_keys.extend(self.library.movie_map[input_id]) rating_keys.extend(self.library.movie_map[input_id])
elif input_id not in self.missing_movies: elif input_id not in self.missing_movies:
@ -1247,11 +1253,13 @@ class CollectionBuilder:
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
continue continue
if input_id not in self.ignore_ids:
if input_id in self.library.show_map: if input_id in self.library.show_map:
rating_keys.extend(self.library.show_map[input_id]) rating_keys.extend(self.library.show_map[input_id])
elif input_id not in self.missing_shows: elif input_id not in self.missing_shows:
self.missing_shows.append(input_id) self.missing_shows.append(input_id)
elif id_type == "imdb" and not self.parts_collection: elif id_type == "imdb" and not self.parts_collection:
if input_id not in self.ignore_imdb_ids:
if input_id in self.library.imdb_map: if input_id in self.library.imdb_map:
rating_keys.extend(self.library.imdb_map[input_id]) rating_keys.extend(self.library.imdb_map[input_id])
else: else:

@ -333,6 +333,13 @@ def parse(attribute, data, datatype=None, methods=None, parent=None, default=Non
if value: if value:
return [v for v in value if v] if isinstance(value, list) else [str(value)] return [v for v in value if v] if isinstance(value, list) else [str(value)]
return [] return []
elif datatype == "intlist":
if value:
try:
return [int(v) for v in value if v] if isinstance(value, list) else [int(value)]
except ValueError:
pass
return []
elif datatype == "dictlist": elif datatype == "dictlist":
final_list = [] final_list = []
for dict_data in get_list(value): for dict_data in get_list(value):

Loading…
Cancel
Save