From 267b02b28b00410529d69c94e21a2cd07ce90d9f Mon Sep 17 00:00:00 2001 From: desimaniac <5501908+desimaniac@users.noreply.github.com> Date: Mon, 10 Feb 2020 11:07:18 -0600 Subject: [PATCH] Log: Renamed log output and function names Clear up confusion on what and where the movies are being removed from ref: - https://github.com/l3uddz/traktarr/issues/119 --- helpers/radarr.py | 16 +++++++++------- helpers/sonarr.py | 4 ++-- traktarr.py | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/helpers/radarr.py b/helpers/radarr.py index efa57f4..51c753f 100644 --- a/helpers/radarr.py +++ b/helpers/radarr.py @@ -35,7 +35,7 @@ def movies_to_tmdb_dict(radarr_movies): return None -def remove_existing_movies(radarr_movies, trakt_movies, callback=None): +def remove_existing_movies_from_trakt_list(radarr_movies, trakt_movies, callback=None): new_movies_list = [] try: @@ -49,7 +49,7 @@ def remove_existing_movies(radarr_movies, trakt_movies, callback=None): # check if movie exists in processed_movies if tmp['movie']['ids']['tmdb'] in processed_movies: movie_year = str(tmp['movie']['year']) if tmp['movie']['year'] else '????' - log.debug("Removing existing movie: \'%s (%s)\'", tmp['movie']['title'], movie_year) + log.debug("Removing existing movie from Trakt list: \'%s (%s)\'", tmp['movie']['title'], movie_year) if callback: callback('movie', tmp) continue @@ -81,7 +81,7 @@ def exclusions_to_tmdb_dict(radarr_exclusions): return None -def remove_existing_exclusions(radarr_exclusions, trakt_movies, callback=None): +def remove_excluded_movies_from_trakt_list(radarr_exclusions, trakt_movies, callback=None): new_movies_list = [] try: @@ -95,7 +95,7 @@ def remove_existing_exclusions(radarr_exclusions, trakt_movies, callback=None): # check if movie exists in processed_movies if tmp['movie']['ids']['tmdb'] in processed_movies: movie_year = str(tmp['movie']['year']) if tmp['movie']['year'] else '????' - log.debug("Removing excluded movie: \'%s (%s)\'", tmp['movie']['title'], movie_year) + log.debug("Removing excluded movie from Trakt list: \'%s (%s)\'", tmp['movie']['title'], movie_year) if callback: callback('movie', tmp) continue @@ -110,7 +110,7 @@ def remove_existing_exclusions(radarr_exclusions, trakt_movies, callback=None): return None -def remove_existing_and_excluded_movies(radarr_movies, radarr_exclusions, trakt_movies, callback=None): +def remove_existing_and_excluded_movies_from_trakt_list(radarr_movies, radarr_exclusions, trakt_movies, callback=None): if not radarr_movies or not trakt_movies: log.error("Inappropriate parameters were supplied.") return None, False @@ -122,13 +122,15 @@ def remove_existing_and_excluded_movies(radarr_movies, radarr_exclusions, trakt_ return None, False # filter out existing movies in radarr from new trakt list - processed_movies_list, removal_successful = remove_existing_movies(radarr_movies, trakt_movies, callback) + processed_movies_list, removal_successful = remove_existing_movies_from_trakt_list(radarr_movies, trakt_movies, + callback) if not processed_movies_list: return None, removal_successful # filter out radarr exclusions from the list above if radarr_exclusions: - processed_movies_list = remove_existing_exclusions(radarr_exclusions, processed_movies_list, callback) + processed_movies_list = remove_excluded_movies_from_trakt_list(radarr_exclusions, processed_movies_list, + callback) movies_removed_count = len(trakt_movies) - len(processed_movies_list) log.debug("Filtered a total of %d movies from the Trakt movies list.", movies_removed_count) diff --git a/helpers/sonarr.py b/helpers/sonarr.py index 922b475..d8c2506 100644 --- a/helpers/sonarr.py +++ b/helpers/sonarr.py @@ -64,7 +64,7 @@ def series_to_tvdb_dict(sonarr_series): return None -def remove_existing_series(sonarr_series, trakt_series, callback=None): +def remove_existing_series_from_trakt_list(sonarr_series, trakt_series, callback=None): new_series_list = [] if not sonarr_series or not trakt_series: @@ -87,7 +87,7 @@ def remove_existing_series(sonarr_series, trakt_series, callback=None): # check if show exists in processed_series if tmp['show']['ids']['tvdb'] in processed_series: show_year = str(tmp['show']['year']) if tmp['show']['year'] else '????' - log.debug("Removing existing show: \'%s (%s)\'", tmp['show']['title'], show_year) + log.debug("Removing existing show from Trakt list: \'%s (%s)\'", tmp['show']['title'], show_year) if callback: callback('show', tmp) continue diff --git a/traktarr.py b/traktarr.py index 13905ba..69462ec 100755 --- a/traktarr.py +++ b/traktarr.py @@ -557,7 +557,7 @@ def shows( remove_rejected_from_recommended = False # build filtered series list without series that exist in sonarr - processed_series_list = sonarr_helper.remove_existing_series( + processed_series_list = sonarr_helper.remove_existing_series_from_trakt_list( pvr_objects_list, trakt_objects_list, callback_remove_recommended if remove_rejected_from_recommended else None @@ -1066,7 +1066,7 @@ def movies( remove_rejected_from_recommended = False # build filtered movie list without movies that exist in radarr - processed_movies_list, removal_successful = radarr_helper.remove_existing_and_excluded_movies( + processed_movies_list, removal_successful = radarr_helper.remove_existing_and_excluded_movies_from_trakt_list( pvr_objects_list, pvr_exclusions_list, trakt_objects_list,