[19] fix genres

pull/847/head
meisnate12 3 years ago
parent 3d7b80cf41
commit be22731d02

@ -1 +1 @@
1.16.3-develop18 1.16.3-develop19

@ -612,30 +612,35 @@ def library_operations(config, library):
raise Failed raise Failed
if library.mass_genre_update or library.genre_mapper: if library.mass_genre_update or library.genre_mapper:
new_genres = [] try:
if library.mass_genre_update: new_genres = []
if tmdb_item and library.mass_genre_update == "tmdb": if library.mass_genre_update:
new_genres = tmdb_item.genres if tmdb_item and library.mass_genre_update == "tmdb":
elif omdb_item and library.mass_genre_update == "omdb": new_genres = tmdb_item.genres
new_genres = omdb_item.genres elif omdb_item and library.mass_genre_update == "omdb":
elif tvdb_item and library.mass_genre_update == "tvdb": new_genres = omdb_item.genres
new_genres = tvdb_item.genres elif tvdb_item and library.mass_genre_update == "tvdb":
elif anidb_item and library.mass_genre_update == "anidb": new_genres = tvdb_item.genres
new_genres = anidb_item.tags elif anidb_item and library.mass_genre_update == "anidb":
if not new_genres: new_genres = anidb_item.tags
logger.info(f"{item.title[:25]:<25} | No Genres Found")
if library.genre_mapper:
if not new_genres:
new_genres = [g.tag for g in item.genres]
mapped_genres = []
for genre in new_genres:
if genre in library.genre_mapper:
if library.genre_mapper[genre]:
mapped_genres.append(library.genre_mapper[genre])
else: else:
mapped_genres.append(genre) raise Failed
new_genres = mapped_genres if not new_genres:
batch_display += f"\n{library.edit_tags('genre', item, sync_tags=new_genres)}" logger.info(f"{item.title[:25]:<25} | No Genres Found")
if library.genre_mapper:
if not new_genres:
new_genres = [g.tag for g in item.genres]
mapped_genres = []
for genre in new_genres:
if genre in library.genre_mapper:
if library.genre_mapper[genre]:
mapped_genres.append(library.genre_mapper[genre])
else:
mapped_genres.append(genre)
new_genres = mapped_genres
batch_display += f"\n{library.edit_tags('genre', item, sync_tags=new_genres)}"
except Failed:
pass
if library.mass_audience_rating_update: if library.mass_audience_rating_update:
try: try:

Loading…
Cancel
Save