|
|
|
@ -117,7 +117,7 @@ numbered_builders = [
|
|
|
|
|
"trakt_watched",
|
|
|
|
|
"trakt_collected"
|
|
|
|
|
]
|
|
|
|
|
smart_collection_invalid = ["collection_mode", "collection_order"]
|
|
|
|
|
smart_collection_invalid = ["collection_order"]
|
|
|
|
|
smart_url_collection_invalid = [
|
|
|
|
|
"run_again", "sync_mode", "show_filtered", "show_missing", "save_missing", "smart_label",
|
|
|
|
|
"radarr_add", "radarr_folder", "radarr_monitor", "radarr_availability",
|
|
|
|
@ -1098,15 +1098,35 @@ class CollectionBuilder:
|
|
|
|
|
logger.info("Validation Successful")
|
|
|
|
|
|
|
|
|
|
def collect_rating_keys(self):
|
|
|
|
|
filtered_keys = {}
|
|
|
|
|
name = self.obj.title if self.obj else self.name
|
|
|
|
|
def add_rating_keys(keys):
|
|
|
|
|
if not isinstance(keys, list):
|
|
|
|
|
keys = [keys]
|
|
|
|
|
self.rating_keys.extend([key for key in keys if key not in self.rating_keys])
|
|
|
|
|
for method, values in self.methods:
|
|
|
|
|
logger.debug("")
|
|
|
|
|
logger.debug(f"Method: {method}")
|
|
|
|
|
logger.debug(f"Values: {values}")
|
|
|
|
|
for value in values:
|
|
|
|
|
total = len(keys)
|
|
|
|
|
max_length = len(str(total))
|
|
|
|
|
if self.filters and self.details["show_filtered"] is True:
|
|
|
|
|
logger.info("")
|
|
|
|
|
logger.info("Filtering Builder:")
|
|
|
|
|
for i, key in enumerate(keys, 1):
|
|
|
|
|
if key not in self.rating_keys:
|
|
|
|
|
if key in filtered_keys:
|
|
|
|
|
if self.details["show_filtered"] is True:
|
|
|
|
|
logger.info(f"{name} Collection | X | {filtered_keys[key]}")
|
|
|
|
|
else:
|
|
|
|
|
try:
|
|
|
|
|
current = self.fetch_item(key)
|
|
|
|
|
except Failed as e:
|
|
|
|
|
logger.error(e)
|
|
|
|
|
continue
|
|
|
|
|
current_title = f"{current.title} ({current.year})" if current.year else current.title
|
|
|
|
|
if self.check_filters(current, f"{(' ' * (max_length - len(str(i))))}{i}/{total}"):
|
|
|
|
|
self.rating_keys.append(key)
|
|
|
|
|
else:
|
|
|
|
|
if key not in filtered_keys:
|
|
|
|
|
filtered_keys[key] = current_title
|
|
|
|
|
if self.details["show_filtered"] is True:
|
|
|
|
|
logger.info(f"{name} Collection | X | {current_title}")
|
|
|
|
|
def check_map(input_ids):
|
|
|
|
|
movie_ids, show_ids = input_ids
|
|
|
|
|
items_found_inside = 0
|
|
|
|
@ -1125,8 +1145,10 @@ class CollectionBuilder:
|
|
|
|
|
elif show_id not in self.missing_shows:
|
|
|
|
|
self.missing_shows.append(show_id)
|
|
|
|
|
return items_found_inside
|
|
|
|
|
for method, values in self.methods:
|
|
|
|
|
for value in values:
|
|
|
|
|
logger.debug("")
|
|
|
|
|
logger.debug(f"Value: {value}")
|
|
|
|
|
logger.debug(f"Builder: {method}: {value}")
|
|
|
|
|
logger.info("")
|
|
|
|
|
if "plex" in method: add_rating_keys(self.library.get_items(method, value))
|
|
|
|
|
elif "tautulli" in method: add_rating_keys(self.library.Tautulli.get_items(self.library, value))
|
|
|
|
@ -1409,16 +1431,14 @@ class CollectionBuilder:
|
|
|
|
|
logger.error(e)
|
|
|
|
|
continue
|
|
|
|
|
current_title = f"{current.title} ({current.year})" if current.year else current.title
|
|
|
|
|
if self.check_filters(current, f"{(' ' * (max_length - len(str(i))))}{i}/{total}"):
|
|
|
|
|
logger.info(util.adjust_space(f"{name} Collection | {'=' if current in collection_items else '+'} | {current_title}"))
|
|
|
|
|
current_operation = "=" if current in collection_items else "+"
|
|
|
|
|
logger.info(util.adjust_space(f"{name} Collection | {current_operation} | {current_title}"))
|
|
|
|
|
if current in collection_items:
|
|
|
|
|
self.plex_map[current.ratingKey] = None
|
|
|
|
|
elif self.smart_label_collection:
|
|
|
|
|
self.library.query_data(current.addLabel, name)
|
|
|
|
|
else:
|
|
|
|
|
self.library.query_data(current.addCollection, name)
|
|
|
|
|
elif self.details["show_filtered"] is True:
|
|
|
|
|
logger.info(f"{name} Collection | X | {current_title}")
|
|
|
|
|
media_type = f"{'Movie' if self.library.is_movie else 'Show'}{'s' if total > 1 else ''}"
|
|
|
|
|
util.print_end()
|
|
|
|
|
logger.info("")
|
|
|
|
|