diff --git a/README.md b/README.md index 12ec1107..d42410db 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Plex Meta Manager -#### Version 1.8.0 +#### Version 1.9.0 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. diff --git a/config/config.yml.template b/config/config.yml.template index de42f393..8f291cc1 100644 --- a/config/config.yml.template +++ b/config/config.yml.template @@ -2,8 +2,21 @@ libraries: # Library mappings must have a colon (:) placed after them Movies: + metadata_path: + - file: config/Movies.yml # You have to create this file the other are online + - git: meisnate12/MovieCharts + - git: meisnate12/Studios + - git: meisnate12/IMDBGenres + - git: meisnate12/People TV Shows: + metadata_path: + - file: config/TV Shows.yml # You have to create this file the other are online + - git: meisnate12/ShowCharts + - git: meisnate12/Networks Anime: + metadata_path: + - file: config/Anime.yml # You have to create this file the other are online + - git: meisnate12/AnimeCharts settings: # Can be individually specified per library as well cache: true cache_expiration: 60 diff --git a/modules/builder.py b/modules/builder.py index ab33dd82..4e998474 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1519,7 +1519,10 @@ class CollectionBuilder: if not self.obj and self.smart_url: self.library.create_smart_collection(self.name, self.smart_type_key, self.smart_url) elif not self.obj and self.smart_label_collection: - self.library.create_smart_labels(self.name, sort=self.smart_sort) + try: + self.library.create_smart_labels(self.name, sort=self.smart_sort) + except Failed: + raise Failed(f"Collection Error: Label: {self.name} was not added to any items in the Library") self.obj = self.library.get_collection(self.name) if self.smart_url and self.smart_url != self.library.smart_filter(self.obj): diff --git a/modules/config.py b/modules/config.py index 3cf54e4a..d59afcbd 100644 --- a/modules/config.py +++ b/modules/config.py @@ -407,6 +407,11 @@ class Config: logger.error("Config Error: metadata_path git is blank") else: params["metadata_path"].append(("Git", path['git'])) + if "file" in path: + if path["file"] is None: + logger.error("Config Error: metadata_path file is blank") + else: + params["metadata_path"].append(("File", path['file'])) else: params["metadata_path"].append(("File", path)) else: diff --git a/modules/tmdb.py b/modules/tmdb.py index 6a139dce..819583e6 100644 --- a/modules/tmdb.py +++ b/modules/tmdb.py @@ -211,7 +211,7 @@ class TMDbAPI: movie_ids.append(credit.id) elif credit.media_type == "tv": try: - show_ids.append(self.config.Convert.tmdb_to_tvdb(credit.id)) + show_ids.append(self.config.Convert.tmdb_to_tvdb(credit.id, fail=True)) except Failed as e: logger.warning(e) for credit in actor_credits.crew: @@ -223,7 +223,7 @@ class TMDbAPI: movie_ids.append(credit.id) elif credit.media_type == "tv": try: - show_ids.append(self.config.Convert.tmdb_to_tvdb(credit.id)) + show_ids.append(self.config.Convert.tmdb_to_tvdb(credit.id, fail=True)) except Failed as e: logger.warning(e) return movie_ids, show_ids @@ -240,9 +240,10 @@ class TMDbAPI: else: raise Failed(f"TMDb Error: {method} method not supported") for tmdb_item in tmdb_items: try: - ids.append(tmdb_item.id if is_movie else self.config.Convert.tmdb_to_tvdb(tmdb_item.id)) + ids.append(tmdb_item.id if is_movie else self.config.Convert.tmdb_to_tvdb(tmdb_item.id, fail=True)) count += 1 - except Failed: + except Failed as e: + logger.error(e) pass if count == amount: break if count == amount: break @@ -263,7 +264,7 @@ class TMDbAPI: tmdb_items = self.Discover.discover_movies(attrs) if is_movie else self.Discover.discover_tv_shows(attrs) for tmdb_item in tmdb_items: try: - ids.append(tmdb_item.id if is_movie else self.config.Convert.tmdb_to_tvdb(tmdb_item.id)) + ids.append(tmdb_item.id if is_movie else self.config.Convert.tmdb_to_tvdb(tmdb_item.id, fail=True)) count += 1 except Failed as e: logger.error(e) @@ -336,7 +337,7 @@ class TMDbAPI: if tmdb_item.media_type == "movie": movie_ids.append(tmdb_item.id) elif tmdb_item.media_type == "tv": - try: show_ids.append(self.config.Convert.tmdb_to_tvdb(tmdb_item.id)) + try: show_ids.append(self.config.Convert.tmdb_to_tvdb(tmdb_item.id, fail=True)) except Failed: pass elif method == "tmdb_movie": tmdb_name = str(self.get_movie(tmdb_id).title) @@ -348,7 +349,7 @@ class TMDbAPI: movie_ids.append(tmdb_item["id"]) elif method == "tmdb_show": tmdb_name = str(self.get_show(tmdb_id).name) - show_ids.append(self.config.Convert.tmdb_to_tvdb(tmdb_id)) + show_ids.append(self.config.Convert.tmdb_to_tvdb(tmdb_id, fail=True)) else: tmdb_name = str(self.get_person(tmdb_id).name) if method == "tmdb_actor": movie_ids, show_ids = self._credits(tmdb_id, actor=True) diff --git a/plex_meta_manager.py b/plex_meta_manager.py index f0984cae..713d5d9e 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -92,7 +92,7 @@ util.centered("| |_) | |/ _ \\ \\/ / | |\\/| |/ _ \\ __/ _` | | |\\/| |/ _` | '_ util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | ") util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| ") util.centered(" |___/ ") -util.centered(" Version: 1.9.0-beta5 ") +util.centered(" Version: 1.9.0 ") util.separator() def start(config_path, is_test, daily, requested_collections, requested_libraries, resume_from):