Updated payload for notifiarr

This commit is contained in:
bobokun 2021-12-17 20:21:27 -05:00
parent d8ab1f25c4
commit 467a615e8b
No known key found for this signature in database
GPG key ID: 9665BA6CF5DC2671
3 changed files with 7 additions and 2 deletions

View file

@ -130,7 +130,10 @@ orphaned:
#Notifiarr integration with webhooks
notifiarr:
#Mandatory to fill out API Key
apikey: ####################################
#Your qBittorrent instance, can be set to any unique value
instance:
test: true
develop: true

View file

@ -83,7 +83,8 @@ class Config:
self.NotifiarrFactory = Notifiarr(self, {
"apikey": self.util.check_for_attribute(self.data, "apikey", parent="notifiarr", throw=True),
"develop": self.util.check_for_attribute(self.data, "develop", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False),
"test": self.util.check_for_attribute(self.data, "test", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False)
"test": self.util.check_for_attribute(self.data, "test", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False),
"instance": self.util.check_for_attribute(self.data, "instance", parent="notifiarr", default=False, do_print=False, save=False)
})
except Failed as e:
logger.error(e)

View file

@ -14,6 +14,7 @@ class Notifiarr:
self.apikey = params["apikey"]
self.develop = params["develop"]
self.test = params["test"]
self.instance = params["instance"]
url, _ = self.get_url("user/validate/")
response = self.config.get(url)
response_json = response.json()
@ -28,5 +29,5 @@ class Notifiarr:
if self.config.trace_mode:
logger.debug(url.replace(self.apikey, "APIKEY"))
test_payload = (f"qbitManage-{self.apikey[:5]}")
params = {"event": test_payload, "qbit_client":self.config.data["qbt"]["host"] if self.test else "notify"}
params = {"event": test_payload, "qbit_client":self.config.data["qbt"]["host"], "instance":self.instance if self.test else "notify"}
return url, params