From 78431f56fc954c9e2e16cf601fd34a7350004840 Mon Sep 17 00:00:00 2001 From: l3uddz Date: Sun, 8 Apr 2018 10:27:24 +0100 Subject: [PATCH] consider 200/201 success response from sonarr/radarr --- media/radarr.py | 2 +- media/sonarr.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/media/radarr.py b/media/radarr.py index eade2a0..57e761c 100644 --- a/media/radarr.py +++ b/media/radarr.py @@ -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: diff --git a/media/sonarr.py b/media/sonarr.py index 22452d9..11e86ad 100644 --- a/media/sonarr.py +++ b/media/sonarr.py @@ -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: