[38] asset fixes

pull/935/head
meisnate12 2 years ago
parent fdc5f0604a
commit 88dfc5b81e

@ -1 +1 @@
1.17.0-develop37
1.17.0-develop38

@ -683,11 +683,11 @@ class MetadataFile(DataFile):
elif f"{attr}.remove" in alias and f"{attr}.sync" in alias:
logger.error(f"Metadata Error: Cannot use {attr}.remove and {attr}.sync together")
elif attr in alias and not group[alias[attr]]:
logger.error(f"Metadata Error: {attr} attribute is blank")
logger.warning(f"Metadata Error: {attr} attribute is blank")
elif f"{attr}.remove" in alias and not group[alias[f"{attr}.remove"]]:
logger.error(f"Metadata Error: {attr}.remove attribute is blank")
logger.warning(f"Metadata Error: {attr}.remove attribute is blank")
elif f"{attr}.sync" in alias and not group[alias[f"{attr}.sync"]]:
logger.error(f"Metadata Error: {attr}.sync attribute is blank")
logger.warning(f"Metadata Error: {attr}.sync attribute is blank")
elif attr in alias or f"{attr}.remove" in alias or f"{attr}.sync" in alias:
add_tags = util.get_list(group[alias[attr]]) if attr in alias else []
if extra:

@ -84,7 +84,7 @@ class Operations:
current_labels = [la.tag for la in self.library.item_labels(item)] if self.library.assets_for_all or self.library.mass_imdb_parental_labels else []
if self.library.assets_for_all and self.library.asset_directory and "Overlay" not in current_labels:
self.library.find_and_upload_assets(item)
self.library.find_and_upload_assets(item, current_labels)
tmdb_id, tvdb_id, imdb_id = self.library.get_ids(item)

@ -931,13 +931,16 @@ class Plex(Library):
self.upload_images(item, poster=poster, background=background, overlay=True)
return asset_location, folder_name
def find_and_upload_assets(self, item):
def find_and_upload_assets(self, item, current_labels):
try:
poster, background, item_dir, name = self.find_item_assets(item)
if poster or background:
self.upload_images(item, poster=poster, background=background)
elif self.show_missing_assets and self.asset_folders:
logger.warning(f"Asset Warning: No poster or background found in the assets folder '{item_dir}'")
if "Overlay" not in current_labels:
if poster or background:
self.upload_images(item, poster=poster, background=background)
elif self.show_missing_assets and self.asset_folders:
logger.warning(f"Asset Warning: No poster or background found in the assets folder '{item_dir}'")
else:
logger.warning(f"Asset Warning: {name} has an Overlay and will be updated when overlays are run")
if isinstance(item, Show):
missing_seasons = ""
@ -950,14 +953,15 @@ class Plex(Library):
found_season = True
elif self.show_missing_season_assets and season.seasonNumber > 0:
missing_seasons += f"\nMissing Season {season.seasonNumber} Poster"
if season_poster or season_background:
if season_poster or season_background and "Overlay" not in [la.tag for la in self.item_labels(season)]:
self.upload_images(season, poster=season_poster, background=season_background)
for episode in self.query(season.episodes):
if episode.seasonEpisode:
episode_poster, episode_background, _, _ = self.find_item_assets(episode, item_asset_directory=item_dir, folder_name=name)
if episode_poster or episode_background:
found_episode = True
self.upload_images(episode, poster=episode_poster, background=episode_background)
if "Overlay" not in [la.tag for la in self.item_labels(episode)]:
self.upload_images(episode, poster=episode_poster, background=episode_background)
elif self.show_missing_episode_assets:
missing_episodes += f"\nMissing {episode.seasonEpisode.upper()} Title Card"
if (found_season and missing_seasons) or (found_episode and missing_episodes):
@ -1038,15 +1042,15 @@ class Plex(Library):
if item_asset_directory:
break
if not item_asset_directory:
extra = ""
if self.asset_folders:
extra = ""
if self.create_asset_folders and asset_directory:
item_asset_directory = os.path.join(asset_directory[0], folder_name)
os.makedirs(item_asset_directory, exist_ok=True)
extra = f"\nAsset Directory Created: {item_asset_directory}"
raise Failed(f"Asset Warning: Unable to find asset folder: '{folder_name}{extra}'")
raise Failed(f"Asset Warning: Unable to find asset folder: '{folder_name}{extra}'")
else:
logger.error(f"Asset Warning: Unable to find asset file: '{file_name}{extra}'")
logger.error(f"Asset Warning: Unable to find asset file: '{file_name}'")
return None, None, item_asset_directory, folder_name
poster_filter = os.path.join(item_asset_directory, f"{file_name}.*")

Loading…
Cancel
Save