mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-23 04:08:16 +08:00
Updated payload for notifiarr
This commit is contained in:
parent
d8ab1f25c4
commit
467a615e8b
3 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
Loading…
Add table
Reference in a new issue