Use V3 endpoint

Will break sonarr V2.
pull/164/head
salty 4 years ago
parent a2e5f2de0f
commit 4bbdf1e5f2

@ -26,7 +26,7 @@ class PVR(ABC):
try:
# request system status to validate api_key
req = requests.get(
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/system/status'),
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/v3/system/status'),
headers=self.headers,
timeout=60,
allow_redirects=False
@ -72,7 +72,7 @@ class PVR(ABC):
try:
# make request
req = requests.get(
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/profile'),
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/v3/profile'),
headers=self.headers,
timeout=60,
allow_redirects=False

@ -9,10 +9,10 @@ log = logger.get_logger(__name__)
class Radarr(PVR):
def get_objects(self):
return self._get_objects('api/movie')
return self._get_objects('api/v3/movie')
def get_exclusions(self):
return self._get_objects('api/exclusions')
return self._get_objects('api/v3/exclusions')
@backoff.on_predicate(backoff.expo, lambda x: x is None, max_tries=4, on_backoff=backoff_handler)
def add_movie(self, movie_tmdb_id, movie_title, movie_year, movie_title_slug, quality_profile_id, root_folder,
@ -38,4 +38,4 @@ class Radarr(PVR):
}
})
return self._add_object('api/movie', payload, identifier_field='tmdbId', identifier=movie_tmdb_id)
return self._add_object('api/v3/movie', payload, identifier_field='tmdbId', identifier=movie_tmdb_id)

Loading…
Cancel
Save