Browse Source

Notifiarr footer and icon attributes set (#977)

pull/987/head
Chris Caron 1 year ago committed by GitHub
parent
commit
bd28bf9651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      apprise/plugins/NotifyNotifiarr.py
  2. 6
      test/test_plugin_notifiarr.py

10
apprise/plugins/NotifyNotifiarr.py

@ -149,8 +149,8 @@ class NotifyNotifiarr(NotifyBase):
}) })
def __init__(self, apikey=None, include_image=None, def __init__(self, apikey=None, include_image=None,
discord_user=None, discord_role=None, event=None, discord_user=None, discord_role=None,
targets=None, source=None, **kwargs): event=None, targets=None, source=None, **kwargs):
""" """
Initialize Notifiarr Object Initialize Notifiarr Object
@ -238,7 +238,7 @@ class NotifyNotifiarr(NotifyBase):
# Define any URL parameters # Define any URL parameters
params = { params = {
'image': 'yes' if self.include_image else 'no' 'image': 'yes' if self.include_image else 'no',
} }
if self.source: if self.source:
@ -310,6 +310,7 @@ class NotifyNotifiarr(NotifyBase):
'title': title, 'title': title,
'content': '', 'content': '',
'description': body, 'description': body,
'footer': self.app_desc,
}, },
'ids': { 'ids': {
'channel': channel, 'channel': channel,
@ -319,6 +320,9 @@ class NotifyNotifiarr(NotifyBase):
if self.include_image and image_url: if self.include_image and image_url:
payload['discord']['text']['icon'] = image_url payload['discord']['text']['icon'] = image_url
payload['discord']['images'] = {
'thumbnail': image_url,
}
if not self._send(payload): if not self._send(payload):
has_error = True has_error = True

6
test/test_plugin_notifiarr.py

@ -94,6 +94,12 @@ apprise_url_tests = (
# Our expected url(privacy=True) startswith() response: # Our expected url(privacy=True) startswith() response:
'privacy_url': 'notifiarr://m...y/#123', 'privacy_url': 'notifiarr://m...y/#123',
}), }),
('notifiarr://123/?apikey=myapikey&image=yes', {
'instance': NotifyNotifiarr,
}),
('notifiarr://123/?apikey=myapikey&image=no', {
'instance': NotifyNotifiarr,
}),
('notifiarr://123/?apikey=myapikey&source=My%20System', { ('notifiarr://123/?apikey=myapikey&source=My%20System', {
'instance': NotifyNotifiarr, 'instance': NotifyNotifiarr,
# Our expected url(privacy=True) startswith() response: # Our expected url(privacy=True) startswith() response:

Loading…
Cancel
Save