consider 200/201 success response from sonarr/radarr

pull/8/head
l3uddz 7 years ago
parent a8a8258399
commit c769888e4f

@ -95,7 +95,7 @@ class Radarr:
log.debug("Request Payload: %s", payload) log.debug("Request Payload: %s", payload)
log.debug("Request Response: %d", req.status_code) 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) log.debug("Successfully added %s (%d)", movie_title, movie_tmdbid)
return True return True
elif 'json' in req.headers['Content-Type'].lower() and 'message' in req.text: 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 Payload: %s", payload)
log.debug("Request Response: %d", req.status_code) 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) log.debug("Successfully added %s (%d)", series_title, series_tvdbid)
return True return True
elif 'json' in req.headers['Content-Type'].lower() and 'errorMessage' in req.text: elif 'json' in req.headers['Content-Type'].lower() and 'errorMessage' in req.text:

Loading…
Cancel
Save