Merge pull request #2 from l3uddz/develop

provide titleSlug to sonarr & radarr
pull/4/head
James 7 years ago committed by GitHub
commit 61e6b6d97c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,14 +76,15 @@ class Radarr:
return None
@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, profile_id, root_folder, search_missing=False):
def add_movie(self, movie_tmdbid, movie_title, movie_year, movie_title_slug, profile_id, root_folder,
search_missing=False):
try:
# generate payload
payload = {
'tmdbId': movie_tmdbid, 'title': movie_title, 'year': movie_year,
'qualityProfileId': profile_id, 'images': [],
'monitored': True, 'rootFolderPath': root_folder,
'minimumAvailability': 'released', 'titleSlug': '',
'minimumAvailability': 'released', 'titleSlug': movie_title_slug,
'addOptions': {'ignoreEpisodesWithFiles': False, 'ignoreEpisodesWithoutFiles': False,
'searchForMovie': search_missing}
}

@ -76,11 +76,11 @@ class Sonarr:
return None
@backoff.on_predicate(backoff.expo, lambda x: x is None, max_tries=4, on_backoff=backoff_handler)
def add_series(self, series_tvdbid, series_title, profile_id, root_folder, search_missing=False):
def add_series(self, series_tvdbid, series_title, series_title_slug, profile_id, root_folder, search_missing=False):
try:
# generate payload
payload = {
'tvdbId': series_tvdbid, 'title': series_title,
'tvdbId': series_tvdbid, 'title': series_title, 'titleSlug': series_title_slug,
'qualityProfileId': profile_id, 'images': [],
'seasons': [], 'seasonFolder': True,
'monitored': True, 'rootFolderPath': root_folder,

@ -106,9 +106,8 @@ def shows(list_type, add_limit=0, add_delay=2.5, no_search=False):
series['show']['country'].upper())
# add show to sonarr
if sonarr.add_series(series['show']['ids']['tvdb'], series['show']['title'], profile_id,
cfg.sonarr.root_folder,
not no_search):
if sonarr.add_series(series['show']['ids']['tvdb'], series['show']['title'],
series['show']['ids']['slug'], profile_id, cfg.sonarr.root_folder, not no_search):
log.info("ADDED %s (%d)", series['show']['title'], series['show']['year'])
added_shows += 1
else:
@ -204,7 +203,7 @@ def movies(list_type, add_limit=0, add_delay=2.5, no_search=False):
', '.join(movie['movie']['genres']), movie['movie']['country'].upper())
# add movie to radarr
if radarr.add_movie(movie['movie']['ids']['tmdb'], movie['movie']['title'], movie['movie']['year'],
profile_id, cfg.radarr.root_folder, not no_search):
movie['movie']['ids']['slug'], profile_id, cfg.radarr.root_folder, not no_search):
log.info("ADDED %s (%d)", movie['movie']['title'], movie['movie']['year'])
added_movies += 1
else:

Loading…
Cancel
Save