diff --git a/VERSION b/VERSION index 81124e53..9536b3d1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.2-develop21 +1.17.2-develop22 diff --git a/modules/builder.py b/modules/builder.py index ca1a0543..17bd2ce5 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1514,7 +1514,7 @@ class CollectionBuilder: elif "reciperr" in method or "stevenlu" in method: ids = self.config.Reciperr.get_imdb_ids(method, value) elif "mdblist" in method: - ids = self.config.Mdblist.get_tmdb_ids(method, value) + ids = self.config.Mdblist.get_tmdb_ids(method, value, self.library.is_movie if not self.playlist else None) elif "tmdb" in method: ids = self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie, self.tmdb_region) elif "trakt" in method: @@ -2098,7 +2098,8 @@ class CollectionBuilder: self.library.add_additions(self.name, [(i.title, self.library.get_id_from_maps(i.ratingKey)) for i in items_added], self.library.is_movie) logger.exorcise() logger.info("") - logger.info(f"{total} {self.builder_level.capitalize()}{'s' if total > 1 else ''} Processed") + item_label = f"{self.builder_level.capitalize()}{'s' if total > 1 else ''}" + logger.info(f"{total} {item_label} Processed {amount_added} {item_label} Added") return amount_added, amount_unchanged def sync_collection(self): diff --git a/modules/mdblist.py b/modules/mdblist.py index 4e49c539..0a80df90 100644 --- a/modules/mdblist.py +++ b/modules/mdblist.py @@ -103,6 +103,7 @@ class Mdblist: return MDbObj(mdb_dict) if self.config.trace_mode: logger.debug(f"ID: {key}") + logger.debug(f"Params: {params}") response = self.config.get_json(api_url, params=params) if "response" in response and response["response"] is False: if response["error"] == "API Limit Reached!": @@ -166,12 +167,14 @@ class Mdblist: valid_lists.append({"url": mdb_url, "limit": list_count, "sort_by": sort_by}) return valid_lists - def get_tmdb_ids(self, method, data): + def get_tmdb_ids(self, method, data, is_movie=None): if method == "mdblist_list": logger.info(f"Processing Mdblist.com List: {data['url']}") logger.info(f"Sort By: {data['sort_by']}") sort, direction = data["sort_by"].split(".") params = {"sort": sort, "sortorder": direction} + if is_movie is not None: + params["mediatype"] = "movie" if is_movie else "show" if data["limit"] > 0: logger.info(f"Limit: {data['limit']} items") params["limit"] = data["limit"] diff --git a/modules/meta.py b/modules/meta.py index 9526db66..f8bed576 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -557,7 +557,9 @@ class MetadataFile(DataFile): person_depth = util.parse("Config", "depth", dynamic_data, parent=f"{map_name} data", methods=person_methods, datatype="int", default=3, minimum=1) person_minimum = util.parse("Config", "minimum", dynamic_data, parent=f"{map_name} data", methods=person_methods, datatype="int", default=3, minimum=1) if "minimum" in person_methods else None person_limit = util.parse("Config", "limit", dynamic_data, parent=f"{map_name} data", methods=person_methods, datatype="int", default=25, minimum=1) if "limit" in person_methods else None - for i, item in enumerate(library.get_all(), 1): + lib_all = library.get_all() + for i, item in enumerate(lib_all, 1): + logger.ghost(f"Scanning: {i}/{len(lib_all)} {item.title}") try: item = self.library.reload(item) for person in getattr(item, f"{auto_type}s")[:person_depth]: diff --git a/modules/operations.py b/modules/operations.py index d67f0dae..c342b404 100644 --- a/modules/operations.py +++ b/modules/operations.py @@ -174,23 +174,23 @@ class Operations: mdb_item = None if any([o and o.startswith("mdb") for o in self.library.meta_operations]): if self.config.Mdblist.limit is False: - if tmdb_id: + if self.library.is_show and tvdb_id and mdb_item is None: try: - mdb_item = self.config.Mdblist.get_movie(tmdb_id) + mdb_item = self.config.Mdblist.get_series(tvdb_id) except Failed as e: logger.error(str(e)) except Exception: - logger.error(f"TMDb ID: {tmdb_id}") + logger.error(f"TVDb ID: {tvdb_id}") raise - elif tvdb_id: + if tmdb_id and mdb_item is None: try: - mdb_item = self.config.Mdblist.get_series(tvdb_id) + mdb_item = self.config.Mdblist.get_movie(tmdb_id) except Failed as e: logger.error(str(e)) except Exception: - logger.error(f"TVDb ID: {tvdb_id}") + logger.error(f"TMDb ID: {tmdb_id}") raise - elif imdb_id: + if imdb_id and mdb_item is None: try: mdb_item = self.config.Mdblist.get_imdb(imdb_id) except Failed as e: @@ -198,7 +198,7 @@ class Operations: except Exception: logger.error(f"IMDb ID: {imdb_id}") raise - else: + if mdb_item is None: logger.info(f"No TMDb ID, TVDb ID, or IMDb ID for Guid: {item.guid}") def get_rating(attribute): diff --git a/modules/radarr.py b/modules/radarr.py index e0c87a4e..2689ddd2 100644 --- a/modules/radarr.py +++ b/modules/radarr.py @@ -147,13 +147,16 @@ class Radarr: if len(exists) > 0: upgrade_qp = [] for movie in exists: - logger.info(f"Already in Radarr | {movie.tmdbId:<7} | {movie.title}") - if movie.qualityProfileId != qp.id: + if movie.qualityProfileId != qp.id and upgrade_existing: upgrade_qp.append(movie) + else: + logger.info(f"Already in Radarr | {movie.tmdbId:<7} | {movie.title}") if self.config.Cache: self.config.Cache.update_radarr_adds(movie.tmdbId, self.library.original_mapping_name) - if upgrade_qp and upgrade_existing: + if upgrade_qp: self.api.edit_multiple_movies(upgrade_qp, quality_profile=qp) + for movie in upgrade_qp: + logger.info(f"Quality Upgraded To {qp.name} | {movie.tmdbId:<7} | {movie.title}") if len(skipped) > 0: for movie in skipped: logger.info(f"Skipped: In Cache | {movie}") diff --git a/modules/sonarr.py b/modules/sonarr.py index df6d6daa..3e53f194 100644 --- a/modules/sonarr.py +++ b/modules/sonarr.py @@ -173,13 +173,16 @@ class Sonarr: if len(exists) > 0: upgrade_qp = [] for series in exists: - logger.info(f"Already in Sonarr | {series.tvdbId:<7} | {series.title}") - if series.qualityProfileId != qp.id: + if series.qualityProfileId != qp.id and upgrade_existing: upgrade_qp.append(series) + else: + logger.info(f"Already in Sonarr | {series.tvdbId:<7} | {series.title}") if self.config.Cache: self.config.Cache.update_sonarr_adds(series.tvdbId, self.library.original_mapping_name) - if upgrade_qp and upgrade_existing: + if upgrade_qp: self.api.edit_multiple_series(upgrade_qp, quality_profile=qp) + for series in upgrade_qp: + logger.info(f"Quality Upgraded To {qp.name} | {series.tvdbId:<7} | {series.title}") if len(skipped) > 0: for series in skipped: logger.info(f"Skipped: In Cache | {series}")