[153] update notifiarr endpoint

pull/1141/head
meisnate12 2 years ago
parent 3f26695089
commit c02659869a

@ -1 +1 @@
1.17.3-develop152 1.17.3-develop153

@ -16,8 +16,8 @@ class Notifiarr:
self.test = params["test"] self.test = params["test"]
logger.secret(self.apikey) logger.secret(self.apikey)
logger.debug(f"Environment: {'Test' if self.test else 'Develop' if self.develop else 'Production'}") logger.debug(f"Environment: {'Test' if self.test else 'Develop' if self.develop else 'Production'}")
url, _ = self.get_url("user/validate/") url, _ = self.get_url("user/pmm/")
response = self.config.get(url) response = self.config.get(url, params={"fetch": "settings"})
try: try:
response_json = response.json() response_json = response.json()
except JSONDecodeError as e: except JSONDecodeError as e:
@ -26,7 +26,7 @@ class Notifiarr:
if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"): if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"):
logger.debug(f"Response: {response_json}") logger.debug(f"Response: {response_json}")
raise Failed(f"({response.status_code} [{response.reason}]) {response_json}") raise Failed(f"({response.status_code} [{response.reason}]) {response_json}")
if not params["test"] and not response_json["details"]["response"]: if not self.test and not response_json["details"]["response"]:
raise Failed("Notifiarr Error: Invalid apikey") raise Failed("Notifiarr Error: Invalid apikey")
def get_url(self, path): def get_url(self, path):

Loading…
Cancel
Save