|
|
|
@ -412,9 +412,9 @@ class Operations:
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
if self.library.mass_genre_update or self.library.genre_mapper:
|
|
|
|
|
if self.library.mass_genre_update:
|
|
|
|
|
new_genres = []
|
|
|
|
|
extra_option = None
|
|
|
|
|
if self.library.mass_genre_update:
|
|
|
|
|
for option in self.library.mass_genre_update:
|
|
|
|
|
if option in ["lock", "unlock", "remove", "reset"]:
|
|
|
|
|
extra_option = option
|
|
|
|
@ -474,9 +474,9 @@ class Operations:
|
|
|
|
|
item_edits += "\nLock Genre (Batched)"
|
|
|
|
|
|
|
|
|
|
if self.library.mass_content_rating_update or self.library.content_rating_mapper:
|
|
|
|
|
if self.library.mass_content_rating_update:
|
|
|
|
|
new_rating = None
|
|
|
|
|
extra_option = None
|
|
|
|
|
if self.library.mass_content_rating_update:
|
|
|
|
|
for option in self.library.mass_content_rating_update:
|
|
|
|
|
if option in ["lock", "unlock", "remove", "reset"]:
|
|
|
|
|
extra_option = option
|
|
|
|
@ -802,7 +802,7 @@ class Operations:
|
|
|
|
|
|
|
|
|
|
if any([x is not None for x, _ in episode_ops]):
|
|
|
|
|
|
|
|
|
|
if any([x == "imdb" for x, _ in episode_ops]) and not imdb_id:
|
|
|
|
|
if any(["imdb" in x for x, _ in episode_ops]) and not imdb_id:
|
|
|
|
|
logger.info(f"No IMDb ID for Guid: {item.guid}")
|
|
|
|
|
|
|
|
|
|
for ep in item.episodes():
|
|
|
|
@ -816,27 +816,33 @@ class Operations:
|
|
|
|
|
for attribute, item_attr in episode_ops:
|
|
|
|
|
if attribute:
|
|
|
|
|
current = getattr(ep, item_attr)
|
|
|
|
|
if attribute == "remove" and current is not None:
|
|
|
|
|
for option in attribute:
|
|
|
|
|
if option in ["lock", "remove"]:
|
|
|
|
|
if option == "remove" and current:
|
|
|
|
|
if item_attr not in ep_remove_edits:
|
|
|
|
|
ep_remove_edits[item_attr] = []
|
|
|
|
|
ep_remove_edits[item_attr].append(ep)
|
|
|
|
|
ep_remove_edits[item_attr].append(ep.ratingKey)
|
|
|
|
|
item_edits += f"\nRemove {name_display[item_attr]} (Batched)"
|
|
|
|
|
elif attribute == "reset" and current is not None:
|
|
|
|
|
elif item_attr not in locked_fields:
|
|
|
|
|
if item_attr not in ep_lock_edits:
|
|
|
|
|
ep_lock_edits[item_attr] = []
|
|
|
|
|
ep_lock_edits[item_attr].append(ep.ratingKey)
|
|
|
|
|
item_edits += f"\nLock {name_display[item_attr]} (Batched)"
|
|
|
|
|
break
|
|
|
|
|
elif option in ["unlock", "reset"]:
|
|
|
|
|
if option == "reset" and current:
|
|
|
|
|
if item_attr not in ep_reset_edits:
|
|
|
|
|
ep_reset_edits[item_attr] = []
|
|
|
|
|
ep_reset_edits[item_attr].append(ep)
|
|
|
|
|
ep_reset_edits[item_attr].append(ep.ratingKey)
|
|
|
|
|
item_edits += f"\nReset {name_display[item_attr]} (Batched)"
|
|
|
|
|
elif attribute in ["unlock", "reset"] and item_attr in episode_locked_fields:
|
|
|
|
|
elif item_attr in locked_fields:
|
|
|
|
|
if item_attr not in ep_unlock_edits:
|
|
|
|
|
ep_unlock_edits[item_attr] = []
|
|
|
|
|
ep_unlock_edits[item_attr].append(ep)
|
|
|
|
|
ep_unlock_edits[item_attr].append(ep.ratingKey)
|
|
|
|
|
item_edits += f"\nUnlock {name_display[item_attr]} (Batched)"
|
|
|
|
|
elif attribute in ["lock", "remove"] and item_attr not in episode_locked_fields:
|
|
|
|
|
if item_attr not in ep_lock_edits:
|
|
|
|
|
ep_lock_edits[item_attr] = []
|
|
|
|
|
ep_lock_edits[item_attr].append(ep)
|
|
|
|
|
item_edits += f"\nLock {name_display[item_attr]} (Batched)"
|
|
|
|
|
elif attribute not in ["lock", "unlock", "remove", "reset"]:
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
try:
|
|
|
|
|
try:
|
|
|
|
|
tmdb_item = tmdb_obj()
|
|
|
|
|
except Failed:
|
|
|
|
@ -849,16 +855,20 @@ class Operations:
|
|
|
|
|
logger.error(er)
|
|
|
|
|
elif imdb_id and attribute == "imdb":
|
|
|
|
|
found_rating = self.config.IMDb.get_episode_rating(imdb_id, ep.seasonNumber, ep.episodeNumber)
|
|
|
|
|
|
|
|
|
|
if found_rating and float(found_rating) > 0:
|
|
|
|
|
else:
|
|
|
|
|
found_rating = option
|
|
|
|
|
if not found_rating:
|
|
|
|
|
logger.info(f"No {option} {name_display[item_attr]} Found")
|
|
|
|
|
raise Failed
|
|
|
|
|
found_rating = f"{float(found_rating):.1f}"
|
|
|
|
|
if str(current) != found_rating:
|
|
|
|
|
if found_rating not in ep_rating_edits[item_attr]:
|
|
|
|
|
ep_rating_edits[item_attr][found_rating] = []
|
|
|
|
|
ep_rating_edits[item_attr][found_rating].append(ep)
|
|
|
|
|
ep_rating_edits[item_attr][found_rating].append(ep.ratingKey)
|
|
|
|
|
item_edits += f"\nUpdate {name_display[item_attr]} (Batched) | {found_rating}"
|
|
|
|
|
else:
|
|
|
|
|
logger.info(f"No {name_display[item_attr]} Found")
|
|
|
|
|
break
|
|
|
|
|
except Failed:
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
if len(item_edits) > 0:
|
|
|
|
|
logger.info(f"Item Edits:{item_edits}")
|
|
|
|
|