Skip to content

Commit

Permalink
Notifiarr footer and icon attributes set (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Oct 15, 2023
1 parent 97c7af4 commit bd28bf9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apprise/plugins/NotifyNotifiarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ class NotifyNotifiarr(NotifyBase):
})

def __init__(self, apikey=None, include_image=None,
discord_user=None, discord_role=None, event=None,
targets=None, source=None, **kwargs):
discord_user=None, discord_role=None,
event=None, targets=None, source=None, **kwargs):
"""
Initialize Notifiarr Object
Expand Down Expand Up @@ -238,7 +238,7 @@ def url(self, privacy=False, *args, **kwargs):

# Define any URL parameters
params = {
'image': 'yes' if self.include_image else 'no'
'image': 'yes' if self.include_image else 'no',
}

if self.source:
Expand Down Expand Up @@ -310,6 +310,7 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
'title': title,
'content': '',
'description': body,
'footer': self.app_desc,
},
'ids': {
'channel': channel,
Expand All @@ -319,6 +320,9 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):

if self.include_image and image_url:
payload['discord']['text']['icon'] = image_url
payload['discord']['images'] = {
'thumbnail': image_url,
}

if not self._send(payload):
has_error = True
Expand Down
6 changes: 6 additions & 0 deletions test/test_plugin_notifiarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
# Our expected url(privacy=True) startswith() response:
'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', {
'instance': NotifyNotifiarr,
# Our expected url(privacy=True) startswith() response:
Expand Down

0 comments on commit bd28bf9

Please sign in to comment.