Skip to content

Commit

Permalink
Merge pull request #185 from meisnate12/develop
Browse files Browse the repository at this point in the history
v1.7.2
  • Loading branch information
meisnate12 authored Apr 8, 2021
2 parents 0f588ae + dcfb4b7 commit d633681
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Plex Meta Manager
#### Version 1.7.1
#### Version 1.7.2

The original concept for Plex Meta Manager is [Plex Auto Collections](https://github.com/mza921/Plex-Auto-Collections), but this is rewritten from the ground up to be able to include a scheduler, metadata edits, multiple libraries, and logging. Plex Meta Manager is a Python 3 script that can be continuously run using YAML configuration files to update on a schedule the metadata of the movies, shows, and collections in your libraries as well as automatically build collections based on various methods all detailed in the wiki. Some collection examples that the script can automatically build and update daily include Plex Based Searches like actor, genre, or studio collections or Collections based on TMDb, IMDb, Trakt, TVDb, AniDB, or MyAnimeList lists and various other services.

Expand Down
10 changes: 7 additions & 3 deletions modules/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ def get_int(parent, method, data_in, methods_in, default_in, minimum=1, maximum=
prefix_list = []
if "exclude_prefix" in dict_methods and method_data[dict_methods["exclude_prefix"]]:
if isinstance(method_data[dict_methods["exclude_prefix"]], list):
prefix_list.extend(method_data[dict_methods["exclude_prefix"]])
prefix_list.extend([exclude for exclude in method_data[dict_methods["exclude_prefix"]] if exclude])
else:
prefix_list.append(str(method_data[dict_methods["exclude_prefix"]]))
exact_list = []
if "exclude" in dict_methods and method_data[dict_methods["exclude"]]:
if isinstance(method_data[dict_methods["exclude"]], list):
exact_list.extend(method_data[dict_methods["exclude"]])
exact_list.extend([exclude for exclude in method_data[dict_methods["exclude"]] if exclude])
else:
exact_list.append(str(method_data[dict_methods["exclude"]]))
if len(prefix_list) == 0 and len(exact_list) == 0:
Expand Down Expand Up @@ -1230,6 +1230,9 @@ def set_image(image_method, images, is_background=False):
except BadRequest:
logger.error(f"Detail: {image_method} failed to update {message}")

if len(self.posters) > 0:
logger.info("")

if len(self.posters) > 1:
logger.info(f"{len(self.posters)} posters found:")
for p in self.posters:
Expand All @@ -1254,7 +1257,8 @@ def set_image(image_method, images, is_background=False):
elif "tmdb_show_details" in self.posters: set_image("tmdb_show_details", self.posters)
else: logger.info("No poster to update")

logger.info("")
if len(self.backgrounds) > 0:
logger.info("")

if len(self.backgrounds) > 1:
logger.info(f"{len(self.backgrounds)} backgrounds found:")
Expand Down
2 changes: 1 addition & 1 deletion modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def mass_metadata(self, library, movie_map, show_map):
util.print_end(length, str(e))
continue
new_genres = [genre.name for genre in tmdb_item.genres]
elif library.mass_genre_update == "omdb":
elif library.mass_genre_update in ["omdb", "imdb"]:
if self.OMDb.limit is True:
break
if "imdb" not in ids:
Expand Down
6 changes: 3 additions & 3 deletions modules/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

logger = logging.getLogger("Plex Meta Manager")

builders = ["plex_all", "plex_collection", "plex_collectionless", "plex_search",]
builders = ["plex_all", "plex_collection", "plex_collectionless", "plex_search"]
search_translation = {
"audio_language": "audioLanguage",
"content_rating": "contentRating",
Expand Down Expand Up @@ -685,8 +685,8 @@ def edit_tags(attr, obj, key=None, extra=None, movie_library=False):
match = re.search("[Ss]\\d+[Ee]\\d+", episode_str)
if match:
output = match.group(0)[1:].split("E" if "E" in match.group(0) else "e")
episode_id = int(output[0])
season_id = int(output[1])
season_id = int(output[0])
episode_id = int(output[1])
logger.info(f"Updating episode S{episode_id}E{season_id} of {mapping_name}...")
try: episode = item.episode(season=season_id, episode=episode_id)
except NotFound: logger.error(f"Metadata Error: episode {episode_id} of season {season_id} not found")
Expand Down
2 changes: 1 addition & 1 deletion modules/sonarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def add_tvdb(self, tvdb_ids, **options):
folder = options["folder"] if "folder" in options else self.root_folder_path
monitor = options["monitor"] if "monitor" in options else self.monitor
quality_profile_id = self.get_profile_id(options["quality"], "quality_profile") if "quality" in options else self.quality_profile_id
language_profile_id = self.get_profile_id(options["language"], "language_profile") if "quality" in options else self.quality_profile_id
language_profile_id = self.get_profile_id(options["language"], "language_profile") if "quality" in options else self.language_profile_id
series = options["series"] if "series" in options else self.series_type
season = options["season"] if "season" in options else self.season_folder
tags = options["tag"] if "tag" in options else self.tag
Expand Down
2 changes: 1 addition & 1 deletion plex_meta_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def fmt_filter(record):
util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | ")
util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| ")
util.centered(" |___/ ")
util.centered(" Version: 1.7.1 ")
util.centered(" Version: 1.7.2 ")
util.separator()

if my_tests:
Expand Down

0 comments on commit d633681

Please sign in to comment.