[22] multiple small text changes

pull/1004/head
meisnate12 2 years ago
parent 01dfae9f83
commit 5987a992bb

@ -1 +1 @@
1.17.2-develop21 1.17.2-develop22

@ -1514,7 +1514,7 @@ class CollectionBuilder:
elif "reciperr" in method or "stevenlu" in method: elif "reciperr" in method or "stevenlu" in method:
ids = self.config.Reciperr.get_imdb_ids(method, value) ids = self.config.Reciperr.get_imdb_ids(method, value)
elif "mdblist" in method: 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: elif "tmdb" in method:
ids = self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie, self.tmdb_region) ids = self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie, self.tmdb_region)
elif "trakt" in method: 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) 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.exorcise()
logger.info("") 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 return amount_added, amount_unchanged
def sync_collection(self): def sync_collection(self):

@ -103,6 +103,7 @@ class Mdblist:
return MDbObj(mdb_dict) return MDbObj(mdb_dict)
if self.config.trace_mode: if self.config.trace_mode:
logger.debug(f"ID: {key}") logger.debug(f"ID: {key}")
logger.debug(f"Params: {params}")
response = self.config.get_json(api_url, params=params) response = self.config.get_json(api_url, params=params)
if "response" in response and response["response"] is False: if "response" in response and response["response"] is False:
if response["error"] == "API Limit Reached!": 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}) valid_lists.append({"url": mdb_url, "limit": list_count, "sort_by": sort_by})
return valid_lists return valid_lists
def get_tmdb_ids(self, method, data): def get_tmdb_ids(self, method, data, is_movie=None):
if method == "mdblist_list": if method == "mdblist_list":
logger.info(f"Processing Mdblist.com List: {data['url']}") logger.info(f"Processing Mdblist.com List: {data['url']}")
logger.info(f"Sort By: {data['sort_by']}") logger.info(f"Sort By: {data['sort_by']}")
sort, direction = data["sort_by"].split(".") sort, direction = data["sort_by"].split(".")
params = {"sort": sort, "sortorder": direction} params = {"sort": sort, "sortorder": direction}
if is_movie is not None:
params["mediatype"] = "movie" if is_movie else "show"
if data["limit"] > 0: if data["limit"] > 0:
logger.info(f"Limit: {data['limit']} items") logger.info(f"Limit: {data['limit']} items")
params["limit"] = data["limit"] params["limit"] = data["limit"]

@ -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_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_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 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: try:
item = self.library.reload(item) item = self.library.reload(item)
for person in getattr(item, f"{auto_type}s")[:person_depth]: for person in getattr(item, f"{auto_type}s")[:person_depth]:

@ -174,23 +174,23 @@ class Operations:
mdb_item = None mdb_item = None
if any([o and o.startswith("mdb") for o in self.library.meta_operations]): if any([o and o.startswith("mdb") for o in self.library.meta_operations]):
if self.config.Mdblist.limit is False: if self.config.Mdblist.limit is False:
if tmdb_id: if self.library.is_show and tvdb_id and mdb_item is None:
try: try:
mdb_item = self.config.Mdblist.get_movie(tmdb_id) mdb_item = self.config.Mdblist.get_series(tvdb_id)
except Failed as e: except Failed as e:
logger.error(str(e)) logger.error(str(e))
except Exception: except Exception:
logger.error(f"TMDb ID: {tmdb_id}") logger.error(f"TVDb ID: {tvdb_id}")
raise raise
elif tvdb_id: if tmdb_id and mdb_item is None:
try: try:
mdb_item = self.config.Mdblist.get_series(tvdb_id) mdb_item = self.config.Mdblist.get_movie(tmdb_id)
except Failed as e: except Failed as e:
logger.error(str(e)) logger.error(str(e))
except Exception: except Exception:
logger.error(f"TVDb ID: {tvdb_id}") logger.error(f"TMDb ID: {tmdb_id}")
raise raise
elif imdb_id: if imdb_id and mdb_item is None:
try: try:
mdb_item = self.config.Mdblist.get_imdb(imdb_id) mdb_item = self.config.Mdblist.get_imdb(imdb_id)
except Failed as e: except Failed as e:
@ -198,7 +198,7 @@ class Operations:
except Exception: except Exception:
logger.error(f"IMDb ID: {imdb_id}") logger.error(f"IMDb ID: {imdb_id}")
raise raise
else: if mdb_item is None:
logger.info(f"No TMDb ID, TVDb ID, or IMDb ID for Guid: {item.guid}") logger.info(f"No TMDb ID, TVDb ID, or IMDb ID for Guid: {item.guid}")
def get_rating(attribute): def get_rating(attribute):

@ -147,13 +147,16 @@ class Radarr:
if len(exists) > 0: if len(exists) > 0:
upgrade_qp = [] upgrade_qp = []
for movie in exists: for movie in exists:
logger.info(f"Already in Radarr | {movie.tmdbId:<7} | {movie.title}") if movie.qualityProfileId != qp.id and upgrade_existing:
if movie.qualityProfileId != qp.id:
upgrade_qp.append(movie) upgrade_qp.append(movie)
else:
logger.info(f"Already in Radarr | {movie.tmdbId:<7} | {movie.title}")
if self.config.Cache: if self.config.Cache:
self.config.Cache.update_radarr_adds(movie.tmdbId, self.library.original_mapping_name) 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) 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: if len(skipped) > 0:
for movie in skipped: for movie in skipped:
logger.info(f"Skipped: In Cache | {movie}") logger.info(f"Skipped: In Cache | {movie}")

@ -173,13 +173,16 @@ class Sonarr:
if len(exists) > 0: if len(exists) > 0:
upgrade_qp = [] upgrade_qp = []
for series in exists: for series in exists:
logger.info(f"Already in Sonarr | {series.tvdbId:<7} | {series.title}") if series.qualityProfileId != qp.id and upgrade_existing:
if series.qualityProfileId != qp.id:
upgrade_qp.append(series) upgrade_qp.append(series)
else:
logger.info(f"Already in Sonarr | {series.tvdbId:<7} | {series.title}")
if self.config.Cache: if self.config.Cache:
self.config.Cache.update_sonarr_adds(series.tvdbId, self.library.original_mapping_name) 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) 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: if len(skipped) > 0:
for series in skipped: for series in skipped:
logger.info(f"Skipped: In Cache | {series}") logger.info(f"Skipped: In Cache | {series}")

Loading…
Cancel
Save