Notifiarr footer and icon attributes set (#977)

This commit is contained in:
Chris Caron 2023-10-15 15:53:34 -04:00 committed by GitHub
parent 97c7af4c4a
commit bd28bf9651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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: