item_radarr_tag and item_sonarr_tag now work with missing items

pull/362/head
meisnate12 3 years ago
parent c8394e4bdb
commit 20d8f4dae8

@ -1539,15 +1539,22 @@ class CollectionBuilder:
logger.info(f"{self.name} Collection | X | {current_title} (TMDb: {missing_id})") logger.info(f"{self.name} Collection | X | {current_title} (TMDb: {missing_id})")
logger.info("") logger.info("")
logger.info(f"{len(missing_movies_with_names)} Movie{'s' if len(missing_movies_with_names) > 1 else ''} Missing") logger.info(f"{len(missing_movies_with_names)} Movie{'s' if len(missing_movies_with_names) > 1 else ''} Missing")
if len(missing_movies_with_names) > 0:
if self.details["save_missing"] is True: if self.details["save_missing"] is True:
self.library.add_missing(self.name, missing_movies_with_names, True) self.library.add_missing(self.name, missing_movies_with_names, True)
if (self.add_to_radarr and self.library.Radarr) or self.run_again: if self.run_again or (self.library.Radarr and (self.add_to_radarr or "item_radarr_tag" in self.item_details)):
missing_tmdb_ids = [missing_id for title, missing_id in missing_movies_with_names] missing_tmdb_ids = [missing_id for title, missing_id in missing_movies_with_names]
if self.add_to_radarr and self.library.Radarr: if self.library.Radarr:
if self.add_to_radarr:
try: try:
self.library.Radarr.add_tmdb(missing_tmdb_ids, **self.radarr_options) self.library.Radarr.add_tmdb(missing_tmdb_ids, **self.radarr_options)
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
if "item_radarr_tag" in self.item_details:
try:
self.library.Radarr.edit_tags(missing_tmdb_ids, self.item_details["item_radarr_tag"], self.item_details["apply_tags"])
except Failed as e:
logger.error(e)
if self.run_again: if self.run_again:
self.run_again_movies.extend(missing_tmdb_ids) self.run_again_movies.extend(missing_tmdb_ids)
if len(self.missing_shows) > 0 and self.library.is_show: if len(self.missing_shows) > 0 and self.library.is_show:
@ -1568,15 +1575,22 @@ class CollectionBuilder:
logger.info(f"{self.name} Collection | X | {current_title} (TVDb: {missing_id})") logger.info(f"{self.name} Collection | X | {current_title} (TVDb: {missing_id})")
logger.info("") logger.info("")
logger.info(f"{len(missing_shows_with_names)} Show{'s' if len(missing_shows_with_names) > 1 else ''} Missing") logger.info(f"{len(missing_shows_with_names)} Show{'s' if len(missing_shows_with_names) > 1 else ''} Missing")
if len(missing_shows_with_names) > 0:
if self.details["save_missing"] is True: if self.details["save_missing"] is True:
self.library.add_missing(self.name, missing_shows_with_names, False) self.library.add_missing(self.name, missing_shows_with_names, False)
if (self.add_to_sonarr and self.library.Sonarr) or self.run_again: if self.run_again or (self.library.Sonarr and (self.add_to_sonarr or "item_sonarr_tag" in self.item_details)):
missing_tvdb_ids = [missing_id for title, missing_id in missing_shows_with_names] missing_tvdb_ids = [missing_id for title, missing_id in missing_shows_with_names]
if self.add_to_sonarr and self.library.Sonarr: if self.library.Sonarr:
if self.add_to_sonarr:
try: try:
self.library.Sonarr.add_tvdb(missing_tvdb_ids, **self.sonarr_options) self.library.Sonarr.add_tvdb(missing_tvdb_ids, **self.sonarr_options)
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
if "item_sonarr_tag" in self.item_details:
try:
self.library.Sonarr.edit_tags(missing_tvdb_ids, self.item_details["item_sonarr_tag"], self.item_details["apply_tags"])
except Failed as e:
logger.error(e)
if self.run_again: if self.run_again:
self.run_again_shows.extend(missing_tvdb_ids) self.run_again_shows.extend(missing_tvdb_ids)

Loading…
Cancel
Save