[58] small fixes

This commit is contained in:
meisnate12 2023-02-05 14:10:08 -05:00
parent d2f8c837d0
commit 1766bf86e9
8 changed files with 40 additions and 7 deletions

View file

@ -15,6 +15,22 @@
Plex Meta Manager is an open source Python 3 project that has been designed to ease the creation and maintenance of metadata, collections, and playlists within a Plex Media Server. The script is designed to be run continuously and be able to update information based on sources outside your plex environment. Plex Meta Manager supports Movie/TV/Music libraries and Playlists. Plex Meta Manager is an open source Python 3 project that has been designed to ease the creation and maintenance of metadata, collections, and playlists within a Plex Media Server. The script is designed to be run continuously and be able to update information based on sources outside your plex environment. Plex Meta Manager supports Movie/TV/Music libraries and Playlists.
## What Can Plex-Meta-Manager Do?
Plex Meta Manager can
1. Create and maintain collections in Plex libraries using external lists, Plex searches, or filters.
2. Create, maintain, and share playlists on Plex servers using the same or similar criteria.
3. Manage metadata [artwork, titles, summaries, release year, etc.] for anything on your Plex server.
4. Add overlays to item artwork to display various details [ratings, resolution, edition, etc.].
5. Send missing items from external lists [for example the IMDB 250] to Radarr or Sonarr for download.
6. and more.
## Getting Started ## Getting Started
These are the high-level steps you must take to get Plex Meta Manager up and running: These are the high-level steps you must take to get Plex Meta Manager up and running:

View file

@ -1 +1 @@
1.18.3-develop57 1.18.3-develop58

View file

@ -297,7 +297,7 @@ docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex
### Timeout ### Timeout
Change the main Plex Meta Manager timeout. This timeout is overwritten by those in your config file for those services. Change the timeout for all non-Plex services (such as TMDb, Radarr, and Trakt). This is overwritten by any timeouts mentioned for specific services in the Configuration File.
<table class="dualTable colwidths-auto align-default table"> <table class="dualTable colwidths-auto align-default table">
<tr> <tr>

View file

@ -31,7 +31,6 @@ Plex Meta Manager can
6. and more. 6. and more.
## Getting Started ## Getting Started
These are the high-level steps you must take to get Plex Meta Manager up and running: These are the high-level steps you must take to get Plex Meta Manager up and running:

View file

@ -1,4 +1,5 @@
import os, re, time import os, re, time
from arrapi import ArrException
from datetime import datetime from datetime import datetime
from modules import anidb, anilist, flixpatrol, icheckmovies, imdb, letterboxd, mal, plex, radarr, reciperr, sonarr, tautulli, tmdb, trakt, tvdb, mdblist, util from modules import anidb, anilist, flixpatrol, icheckmovies, imdb, letterboxd, mal, plex, radarr, reciperr, sonarr, tautulli, tmdb, trakt, tvdb, mdblist, util
from modules.util import Failed, FilterFailed, NonExisting, NotScheduled, NotScheduledRange, Deleted from modules.util import Failed, FilterFailed, NonExisting, NotScheduled, NotScheduledRange, Deleted
@ -2496,11 +2497,17 @@ class CollectionBuilder:
added_to_radarr += len(added) added_to_radarr += len(added)
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
except ArrException as e:
logger.stacktrace()
logger.error(f"Arr Error: {e}")
if "item_radarr_tag" in self.item_details: if "item_radarr_tag" in self.item_details:
try: try:
self.library.Radarr.edit_tags(missing_tmdb_ids, self.item_details["item_radarr_tag"], self.item_details["apply_tags"]) self.library.Radarr.edit_tags(missing_tmdb_ids, self.item_details["item_radarr_tag"], self.item_details["apply_tags"])
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
except ArrException as e:
logger.stacktrace()
logger.error(f"Arr 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(filtered_movies_with_names) > 0 and self.do_report: if len(filtered_movies_with_names) > 0 and self.do_report:
@ -2541,11 +2548,17 @@ class CollectionBuilder:
added_to_sonarr += len(added) added_to_sonarr += len(added)
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
except ArrException as e:
logger.stacktrace()
logger.error(f"Arr Error: {e}")
if "item_sonarr_tag" in self.item_details: if "item_sonarr_tag" in self.item_details:
try: try:
self.library.Sonarr.edit_tags(missing_tvdb_ids, self.item_details["item_sonarr_tag"], self.item_details["apply_tags"]) self.library.Sonarr.edit_tags(missing_tvdb_ids, self.item_details["item_sonarr_tag"], self.item_details["apply_tags"])
except Failed as e: except Failed as e:
logger.error(e) logger.error(e)
except ArrException as e:
logger.stacktrace()
logger.error(f"Arr 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)
if len(filtered_shows_with_names) > 0 and self.do_report: if len(filtered_shows_with_names) > 0 and self.do_report:

View file

@ -281,7 +281,7 @@ class Library(ABC):
return image_path return image_path
@abstractmethod @abstractmethod
def item_posters(self, item): def item_posters(self, item, providers=None):
pass pass
@abstractmethod @abstractmethod

View file

@ -322,6 +322,8 @@ class Operations:
elif tvdb_item and self.library.mass_genre_update == "tvdb": elif tvdb_item and self.library.mass_genre_update == "tvdb":
new_genres = tvdb_item.genres new_genres = tvdb_item.genres
elif anidb_item and self.library.mass_genre_update in anidb.weights: elif anidb_item and self.library.mass_genre_update in anidb.weights:
logger.trace(anidb_item.main_title)
logger.trace(anidb_item.tags)
new_genres = [str(t).title() for t, w in anidb_item.tags.items() if w >= anidb.weights[self.library.mass_genre_update]] new_genres = [str(t).title() for t, w in anidb_item.tags.items() if w >= anidb.weights[self.library.mass_genre_update]]
elif mal_item and self.library.mass_genre_update == "mal": elif mal_item and self.library.mass_genre_update == "mal":
new_genres = mal_item.genres new_genres = mal_item.genres
@ -514,7 +516,11 @@ class Operations:
self.library.background_update(item, new_background, tmdb=tmdb_item.backdrop_url if tmdb_item else None) self.library.background_update(item, new_background, tmdb=tmdb_item.backdrop_url if tmdb_item else None)
if self.library.is_show: if self.library.is_show:
real_show = None
try:
real_show = tmdb_item.load_show() if tmdb_item else None real_show = tmdb_item.load_show() if tmdb_item else None
except Failed as e:
logger.error(e)
tmdb_seasons = {s.season_number: s for s in real_show.seasons} if real_show else {} tmdb_seasons = {s.season_number: s for s in real_show.seasons} if real_show else {}
for season in self.library.query(item.seasons): for season in self.library.query(item.seasons):
try: try:

View file

@ -171,7 +171,7 @@ class Overlays:
else: else:
reset_list = [] reset_list = []
try: try:
new_backup = self.library.item_posters(item) new_backup = self.library.item_posters(item, providers=reset_list)
except Failed as e: except Failed as e:
if any(r in reset_list for r in ["plex", "tmdb"]): if any(r in reset_list for r in ["plex", "tmdb"]):
logger.error(e) logger.error(e)
@ -339,7 +339,6 @@ class Overlays:
new_poster.save(temp, exif=exif_tags) new_poster.save(temp, exif=exif_tags)
self.library.upload_poster(item, temp) self.library.upload_poster(item, temp)
self.library.edit_tags("label", item, add_tags=["Overlay"], do_print=False) self.library.edit_tags("label", item, add_tags=["Overlay"], do_print=False)
self.library.reload(item, force=True)
poster_compare = poster.compare if poster else item.thumb poster_compare = poster.compare if poster else item.thumb
logger.info(f"{item_title[:60]:<60} | Overlays Applied: {', '.join(over_names)}") logger.info(f"{item_title[:60]:<60} | Overlays Applied: {', '.join(over_names)}")
except (OSError, BadRequest, SyntaxError) as e: except (OSError, BadRequest, SyntaxError) as e: