diff --git a/media/radarr.py b/media/radarr.py index aa7ba38..6da8d58 100644 --- a/media/radarr.py +++ b/media/radarr.py @@ -13,15 +13,15 @@ class Radarr(PVR): @backoff.on_predicate(backoff.expo, lambda x: x is None, max_tries=4, on_backoff=backoff_handler) def add_movie(self, movie_tmdbid, movie_title, movie_year, movie_title_slug, profile_id, root_folder, - min_avail, search_missing=False): + min_availability_temp, search_missing=False): payload = self._prepare_add_object_payload(movie_title, movie_title_slug, profile_id, root_folder) # replace radarr minimum_availability if supplied - if min_avail == 'announced': + if min_availability_temp == 'announced': minimum_availability = 'announced' - elif min_avail == 'in_cinemas': + elif min_availability_temp == 'in_cinemas': minimum_availability = 'inCinemas' - elif min_avail == 'predb': + elif min_availability_temp == 'predb': minimum_availability = 'preDB' else: minimum_availability = 'released' diff --git a/traktarr.py b/traktarr.py index 8c81954..a2156f0 100755 --- a/traktarr.py +++ b/traktarr.py @@ -455,11 +455,10 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False): # replace radarr.minimum_availability if minimum_availability is supplied valid_min_avail = ['announced', 'in_cinemas', 'released', 'predb'] - if cfg['radarr']['minimum_availability'] not in valid_min_avail: - cfg['radarr']['minimum_availability'] = 'released' - if minimum_availability: cfg['radarr']['minimum_availability'] = minimum_availability + elif cfg['radarr']['minimum_availability'] not in valid_min_avail: + cfg['radarr']['minimum_availability'] = 'released' log.debug('Set minimum availability to: \'%s\'', cfg['radarr']['minimum_availability']) @@ -585,11 +584,10 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen # replace radarr.minimum_availability if minimum_availability is supplied valid_min_avail = ['announced', 'in_cinemas', 'released', 'predb'] - if cfg['radarr']['minimum_availability'] not in valid_min_avail: - cfg['radarr']['minimum_availability'] = 'released' - if minimum_availability: cfg['radarr']['minimum_availability'] = minimum_availability + elif cfg['radarr']['minimum_availability'] not in valid_min_avail: + cfg['radarr']['minimum_availability'] = 'released' log.debug('Set minimum availability to: \'%s\'', cfg['radarr']['minimum_availability'])