diff --git a/modules/config.py b/modules/config.py index d469fcc6..3cf54e4a 100644 --- a/modules/config.py +++ b/modules/config.py @@ -381,6 +381,14 @@ class Config: else: params["mass_audience_rating_update"] = None + if lib and "mass_critic_rating_update" in lib and lib["mass_critic_rating_update"]: + params["mass_critic_rating_update"] = check_for_attribute(lib, "mass_critic_rating_update", test_list=mass_update_options, default_is_none=True, save=False) + if self.OMDb is None and params["mass_critic_rating_update"] == "omdb": + params["mass_critic_rating_update"] = None + logger.error("Config Error: mass_critic_rating_update cannot be omdb without a successful OMDb Connection") + else: + params["mass_critic_rating_update"] = None + try: if lib and "metadata_path" in lib: params["metadata_path"] = [] diff --git a/modules/plex.py b/modules/plex.py index 3a6935b8..9a4cd821 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -335,7 +335,8 @@ class PlexAPI: self.save_missing = params["save_missing"] self.mass_genre_update = params["mass_genre_update"] self.mass_audience_rating_update = params["mass_audience_rating_update"] - self.mass_update = self.mass_genre_update or self.mass_audience_rating_update + self.mass_critic_rating_update = params["mass_critic_rating_update"] + self.mass_update = self.mass_genre_update or self.mass_audience_rating_update or self.mass_critic_rating_update self.plex = params["plex"] self.url = params["plex"]["url"] self.token = params["plex"]["token"] diff --git a/plex_meta_manager.py b/plex_meta_manager.py index fa58744a..f0984cae 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -264,7 +264,7 @@ def mass_metadata(config, library, movie_map, show_map): imdb_id = config.Convert.tvdb_to_imdb(tvdb_id) tmdb_item = None - if library.mass_genre_update == "tmdb" or library.mass_audience_rating_update == "tmdb": + if library.mass_genre_update == "tmdb" or library.mass_audience_rating_update == "tmdb" or library.mass_critic_rating_update == "tmdb": if tmdb_id: try: tmdb_item = config.TMDb.get_movie(tmdb_id) if library.is_movie else config.TMDb.get_show(tmdb_id) @@ -274,7 +274,7 @@ def mass_metadata(config, library, movie_map, show_map): util.print_end(length, f"{item.title[:25]:<25} | No TMDb ID for Guid: {item.guid}") omdb_item = None - if library.mass_genre_update in ["omdb", "imdb"] or library.mass_audience_rating_update in ["omdb", "imdb"]: + if library.mass_genre_update in ["omdb", "imdb"] or library.mass_audience_rating_update in ["omdb", "imdb"] or library.mass_critic_rating_update in ["omdb", "imdb"]: if config.OMDb.limit is False: if imdb_id: try: @@ -307,7 +307,7 @@ def mass_metadata(config, library, movie_map, show_map): util.print_end(length, f"{item.title[:25]:<25} | Genres | {display_str}") except Failed: pass - if library.mass_audience_rating_update: + if library.mass_audience_rating_update or library.mass_critic_rating_update: try: if tmdb_item and library.mass_genre_update == "tmdb": new_rating = tmdb_item.vote_average @@ -317,9 +317,13 @@ def mass_metadata(config, library, movie_map, show_map): raise Failed if new_rating is None: util.print_end(length, f"{item.title[:25]:<25} | No Rating Found") - elif str(item.audienceRating) != str(new_rating): - library.edit_query(item, {"audienceRating.value": new_rating, "audienceRating.locked": 1}) - util.print_end(length, f"{item.title[:25]:<25} | Audience Rating | {new_rating}") + else: + if library.mass_audience_rating_update and str(item.audienceRating) != str(new_rating): + library.edit_query(item, {"audienceRating.value": new_rating, "audienceRating.locked": 1}) + util.print_end(length, f"{item.title[:25]:<25} | Audience Rating | {new_rating}") + if library.mass_critic_rating_update and str(item.rating) != str(new_rating): + library.edit_query(item, {"rating.value": new_rating, "rating.locked": 1}) + util.print_end(length, f"{item.title[:25]:<25} | Critic Rating | {new_rating}") except Failed: pass