consider 200/201 success response from sonarr/radarr

pull/54/head
l3uddz 7 years ago
parent c544911211
commit 78431f56fc

@ -95,7 +95,7 @@ class Radarr:
log.debug("Request Payload: %s", payload)
log.debug("Request Response: %d", req.status_code)
if req.status_code == 201 and req.json()['tmdbId'] == movie_tmdbid:
if (req.status_code == 201 or req.status_code == 200) and req.json()['tmdbId'] == movie_tmdbid:
log.debug("Successfully added %s (%d)", movie_title, movie_tmdbid)
return True
elif 'json' in req.headers['Content-Type'].lower() and 'message' in req.text:

@ -141,7 +141,7 @@ class Sonarr:
log.debug("Request Payload: %s", payload)
log.debug("Request Response: %d", req.status_code)
if req.status_code == 201 and req.json()['tvdbId'] == series_tvdbid:
if (req.status_code == 201 or req.status_code == 200) and req.json()['tvdbId'] == series_tvdbid:
log.debug("Successfully added %s (%d)", series_title, series_tvdbid)
return True
elif 'json' in req.headers['Content-Type'].lower() and 'errorMessage' in req.text:

Loading…
Cancel
Save