From 7fb3554ec797e4ff92c7692fc10fdb8b23c63b28 Mon Sep 17 00:00:00 2001 From: desimaniac <5501908+desimaniac@users.noreply.github.com> Date: Fri, 14 Jun 2019 03:14:21 -0500 Subject: [PATCH] Logs: Misc tweaks to log output. --- helpers/trakt.py | 14 +++++++------- media/pvr.py | 4 ++-- traktarr.py | 6 +++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/helpers/trakt.py b/helpers/trakt.py index 5083f94..58513b2 100644 --- a/helpers/trakt.py +++ b/helpers/trakt.py @@ -95,15 +95,15 @@ def blacklisted_show_id(show, blacklisted_ids): blacklisted_ids = sorted(map(int, blacklisted_ids)) try: if not show['show']['ids']['tvdb'] or not isinstance(show['show']['ids']['tvdb'], int): - log.debug("%s was blacklisted because it had an invalid tvdb id", show['show']['title']) + log.debug("%s was blacklisted because it had an invalid TVDB ID", show['show']['title']) blacklisted = True elif show['show']['ids']['tvdb'] in blacklisted_ids: - log.debug("%s was blacklisted because it had a blacklisted tvdb id of: %d", show['show']['title'], + log.debug("%s was blacklisted because it had a blacklisted TVDB ID of: %d", show['show']['title'], show['show']['ids']['tvdb']) blacklisted = True except Exception: - log.exception("Exception determining if show had a blacklisted tvdb id %s: ", show) + log.exception("Exception determining if show had a blacklisted TVDB ID %s: ", show) return blacklisted @@ -162,7 +162,7 @@ def blacklisted_movie_year(movie, earliest_year, latest_year): blacklisted = True else: if int(year) < earliest_year or int(year) > latest_year: - log.debug("%s was blacklisted because it's year is: %d", movie['movie']['title'], int(year)) + log.debug("%s was blacklisted because its year is: %d", movie['movie']['title'], int(year)) blacklisted = True except Exception: log.exception("Exception determining if movie is within min_year and max_year ranger %s:", movie) @@ -225,15 +225,15 @@ def blacklisted_movie_id(movie, blacklisted_ids): blacklisted_ids = sorted(map(int, blacklisted_ids)) try: if not movie['movie']['ids']['tmdb'] or not isinstance(movie['movie']['ids']['tmdb'], int): - log.debug("%s was blacklisted because it had an invalid tmdb id", movie['movie']['title']) + log.debug("%s was blacklisted because it had an invalid TMDB ID", movie['movie']['title']) blacklisted = True elif movie['movie']['ids']['tmdb'] in blacklisted_ids: - log.debug("%s was blacklisted because it had a blacklisted tmdb id of: %d", movie['movie']['title'], + log.debug("%s was blacklisted because it had a blacklisted TMDB ID of: %d", movie['movie']['title'], movie['movie']['ids']['tmdb']) blacklisted = True except Exception: - log.exception("Exception determining if show had a blacklisted tmdb id %s: ", movie) + log.exception("Exception determining if show had a blacklisted TMDB ID %s: ", movie) return blacklisted diff --git a/media/pvr.py b/media/pvr.py index 403d9f6..45d95a0 100644 --- a/media/pvr.py +++ b/media/pvr.py @@ -85,11 +85,11 @@ class PVR(ABC): if profile['name'].lower() == profile_name.lower(): log.debug("Found ID of %s profile: %d", profile_name, profile['id']) return profile['id'] - log.debug("Profile %s with id %d did not match %s", profile['name'], profile['id'], profile_name) + log.debug("Profile %s with ID %d did not match %s", profile['name'], profile['id'], profile_name) else: log.error("Failed to retrieve all quality profiles, request response: %d", req.status_code) except Exception: - log.exception("Exception retrieving id of profile %s: ", profile_name) + log.exception("Exception retrieving ID of profile %s: ", profile_name) return None def _prepare_add_object_payload(self, title, title_slug, profile_id, root_folder): diff --git a/traktarr.py b/traktarr.py index f3a8d99..9a986bb 100755 --- a/traktarr.py +++ b/traktarr.py @@ -530,6 +530,10 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen sorted_movies_list = misc_helper.sorted_list(processed_movies_list, 'movie', 'votes') log.info("Sorted movies list to process by highest votes") + # display specified RT score + if rating is not None and 'omdb' in cfg and 'api_key' in cfg['omdb'] and cfg['omdb']['api_key']: + log.debug("Minimum Rotten Tomatoes score specified: %s%%", rating) + # loop movies log.info("Processing list now...") for sorted_movie in sorted_movies_list: @@ -550,7 +554,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen if rating is not None and 'omdb' in cfg and 'api_key' in cfg['omdb'] and cfg['omdb']['api_key']: movie_rating = rating_helper.get_rating(cfg['omdb']['api_key'], sorted_movie) if movie_rating == -1: - log.debug("Skipping: %s because it did not have a rating/lacked imdbID", + log.debug("Skipping: %s because it did not have a Rotten Tomatoes rating/lacked IMDB ID", sorted_movie['movie']['title']) continue if (rating is None or movie_rating is None) or movie_rating >= rating: