[64] fix item_assets with metadata specific directories

pull/1234/head
meisnate12 2 years ago
parent 2df6206461
commit de5ed4d916

@ -1 +1 @@
1.18.0-develop63 1.18.0-develop64

@ -2471,8 +2471,8 @@ class CollectionBuilder:
tvdb_paths = [] tvdb_paths = []
for item in self.items: for item in self.items:
current_labels = [la.tag for la in self.library.item_labels(item)] current_labels = [la.tag for la in self.library.item_labels(item)]
if "item_assets" in self.item_details and self.library.asset_directory and "Overlay" not in current_labels: if "item_assets" in self.item_details and self.asset_directory and "Overlay" not in current_labels:
self.library.find_and_upload_assets(item, current_labels) self.library.find_and_upload_assets(item, current_labels, asset_directory=self.asset_directory)
self.library.edit_tags("label", item, add_tags=add_tags, remove_tags=remove_tags, sync_tags=sync_tags) self.library.edit_tags("label", item, add_tags=add_tags, remove_tags=remove_tags, sync_tags=sync_tags)
self.library.edit_tags("genre", item, add_tags=add_genres, remove_tags=remove_genres, sync_tags=sync_genres) self.library.edit_tags("genre", item, add_tags=add_genres, remove_tags=remove_genres, sync_tags=sync_genres)
if "item_edition" in self.item_details and item.editionTitle != self.item_details["item_edition"]: if "item_edition" in self.item_details and item.editionTitle != self.item_details["item_edition"]:

@ -1084,11 +1084,11 @@ class Plex(Library):
updated = True updated = True
return asset_location, folder_name, updated return asset_location, folder_name, updated
def find_and_upload_assets(self, item, current_labels): def find_and_upload_assets(self, item, current_labels, asset_directory=None):
item_dir = None item_dir = None
name = None name = None
try: try:
poster, background, item_dir, name = self.find_item_assets(item) poster, background, item_dir, name = self.find_item_assets(item, asset_directory=asset_directory)
if "Overlay" not in current_labels: if "Overlay" not in current_labels:
if poster or background: if poster or background:
self.upload_images(item, poster=poster, background=background) self.upload_images(item, poster=poster, background=background)
@ -1106,7 +1106,7 @@ class Plex(Library):
found_episode = False found_episode = False
for season in self.query(item.seasons): for season in self.query(item.seasons):
try: try:
season_poster, season_background, _, _ = self.find_item_assets(season, item_asset_directory=item_dir, folder_name=name) season_poster, season_background, _, _ = self.find_item_assets(season, item_asset_directory=item_dir, asset_directory=asset_directory, folder_name=name)
if season_poster: if season_poster:
found_season = True found_season = True
elif self.show_missing_season_assets and season.seasonNumber > 0: elif self.show_missing_season_assets and season.seasonNumber > 0:
@ -1119,7 +1119,7 @@ class Plex(Library):
for episode in self.query(season.episodes): for episode in self.query(season.episodes):
try: try:
if episode.seasonEpisode: if episode.seasonEpisode:
episode_poster, episode_background, _, _ = self.find_item_assets(episode, item_asset_directory=item_dir, folder_name=name) episode_poster, episode_background, _, _ = self.find_item_assets(episode, item_asset_directory=item_dir, asset_directory=asset_directory, folder_name=name)
if episode_poster or episode_background: if episode_poster or episode_background:
found_episode = True found_episode = True
if "Overlay" not in [la.tag for la in self.item_labels(episode)]: if "Overlay" not in [la.tag for la in self.item_labels(episode)]:
@ -1136,7 +1136,7 @@ class Plex(Library):
found_album = False found_album = False
for album in self.query(item.albums): for album in self.query(item.albums):
try: try:
album_poster, album_background, _, _ = self.find_item_assets(album, item_asset_directory=item_dir, folder_name=name) album_poster, album_background, _, _ = self.find_item_assets(album, item_asset_directory=item_dir, asset_directory=asset_directory, folder_name=name)
if album_poster or album_background: if album_poster or album_background:
found_album = True found_album = True
elif self.show_missing_season_assets: elif self.show_missing_season_assets:

Loading…
Cancel
Save