[22] multiple small text changes

This commit is contained in:
meisnate12 2022-08-09 01:35:21 -04:00
parent 01dfae9f83
commit 5987a992bb
7 changed files with 34 additions and 22 deletions

View file

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

View file

@ -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):

View file

@ -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"]

View file

@ -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]:

View file

@ -174,15 +174,7 @@ 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:
try:
mdb_item = self.config.Mdblist.get_movie(tmdb_id)
except Failed as e:
logger.error(str(e))
except Exception:
logger.error(f"TMDb ID: {tmdb_id}")
raise
elif tvdb_id:
if self.library.is_show and tvdb_id and mdb_item is None:
try:
mdb_item = self.config.Mdblist.get_series(tvdb_id)
except Failed as e:
@ -190,7 +182,15 @@ class Operations:
except Exception:
logger.error(f"TVDb ID: {tvdb_id}")
raise
elif imdb_id:
if tmdb_id and mdb_item is None:
try:
mdb_item = self.config.Mdblist.get_movie(tmdb_id)
except Failed as e:
logger.error(str(e))
except Exception:
logger.error(f"TMDb ID: {tmdb_id}")
raise
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):

View file

@ -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}")

View file

@ -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}")