mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Consolidate redundant subject options.
Fix emoticon handling for html cards. Fix cut/paste CONFIG errors.
This commit is contained in:
parent
9cdd2eef81
commit
ea9d0fc449
2 changed files with 7 additions and 19 deletions
|
@ -215,7 +215,6 @@ _CONFIG_DEFINITIONS = {
|
||||||
'HIPCHAT_URL': (str, 'Hipchat', ''),
|
'HIPCHAT_URL': (str, 'Hipchat', ''),
|
||||||
'HIPCHAT_COLOR': (str, 'Hipchat', ''),
|
'HIPCHAT_COLOR': (str, 'Hipchat', ''),
|
||||||
'HIPCHAT_INCL_SUBJECT': (int, 'Hipchat', 1),
|
'HIPCHAT_INCL_SUBJECT': (int, 'Hipchat', 1),
|
||||||
'HIPCHAT_FROM_SUBJECT': (int, 'Hipchat', 0),
|
|
||||||
'HIPCHAT_INCL_PMSLINK': (int, 'Hipchat', 0),
|
'HIPCHAT_INCL_PMSLINK': (int, 'Hipchat', 0),
|
||||||
'HIPCHAT_INCL_POSTER': (int, 'Hipchat', 0),
|
'HIPCHAT_INCL_POSTER': (int, 'Hipchat', 0),
|
||||||
'HIPCHAT_EMOTICON': (str, 'Hipchat', ''),
|
'HIPCHAT_EMOTICON': (str, 'Hipchat', ''),
|
||||||
|
|
|
@ -2725,9 +2725,8 @@ class HIPCHAT(object):
|
||||||
self.apiurl = plexpy.CONFIG.HIPCHAT_URL
|
self.apiurl = plexpy.CONFIG.HIPCHAT_URL
|
||||||
self.color = plexpy.CONFIG.HIPCHAT_COLOR
|
self.color = plexpy.CONFIG.HIPCHAT_COLOR
|
||||||
self.emoticon = plexpy.CONFIG.HIPCHAT_EMOTICON
|
self.emoticon = plexpy.CONFIG.HIPCHAT_EMOTICON
|
||||||
self.from_subject = plexpy.CONFIG.HIPCHAT_FROM_SUBJECT
|
self.incl_pmslink = plexpy.CONFIG.HIPCHAT_INCL_PMSLINK
|
||||||
self.incl_pmslink = plexpy.CONFIG.FACEBOOK_INCL_PMSLINK
|
self.incl_poster = plexpy.CONFIG.HIPCHAT_INCL_POSTER
|
||||||
self.incl_poster = plexpy.CONFIG.FACEBOOK_INCL_POSTER
|
|
||||||
self.incl_subject = plexpy.CONFIG.HIPCHAT_INCL_SUBJECT
|
self.incl_subject = plexpy.CONFIG.HIPCHAT_INCL_SUBJECT
|
||||||
|
|
||||||
def notify(self, message, subject, **kwargs):
|
def notify(self, message, subject, **kwargs):
|
||||||
|
@ -2739,17 +2738,11 @@ class HIPCHAT(object):
|
||||||
text = message.encode('utf-8')
|
text = message.encode('utf-8')
|
||||||
|
|
||||||
if self.incl_subject:
|
if self.incl_subject:
|
||||||
text = subject.encode('utf-8') + ': ' + text
|
data['from'] = subject.encode('utf-8')
|
||||||
|
|
||||||
if self.emoticon:
|
|
||||||
text = self.emoticon + ' ' + text
|
|
||||||
|
|
||||||
if self.color:
|
if self.color:
|
||||||
data['color'] = self.color
|
data['color'] = self.color
|
||||||
|
|
||||||
if self.from_subject:
|
|
||||||
data['from'] = subject.encode('utf-8')
|
|
||||||
|
|
||||||
if self.incl_poster and 'metadata' in kwargs:
|
if self.incl_poster and 'metadata' in kwargs:
|
||||||
pretty_metadata = PrettyMetadata(kwargs['metadata'])
|
pretty_metadata = PrettyMetadata(kwargs['metadata'])
|
||||||
poster_url = pretty_metadata.get_poster_url()
|
poster_url = pretty_metadata.get_poster_url()
|
||||||
|
@ -2795,6 +2788,8 @@ class HIPCHAT(object):
|
||||||
data['card'] = card
|
data['card'] = card
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
if self.emoticon:
|
||||||
|
text = self.emoticon + ' ' + text
|
||||||
data['message'] = text
|
data['message'] = text
|
||||||
data['message_format'] = 'text'
|
data['message_format'] = 'text'
|
||||||
|
|
||||||
|
@ -2854,17 +2849,11 @@ class HIPCHAT(object):
|
||||||
{'label': 'Hipchat Emoticon',
|
{'label': 'Hipchat Emoticon',
|
||||||
'value': self.emoticon,
|
'value': self.emoticon,
|
||||||
'name': 'hipchat_emoticon',
|
'name': 'hipchat_emoticon',
|
||||||
'description': 'Include an emoticon tag at the beginning of all notifications (e.g. (taco)). Leave blank for none.'
|
'description': 'Include an emoticon tag at the beginning of text notifications (e.g. (taco)). Leave blank for none.'
|
||||||
' Use a stock emoticon or create a custom emoticon'
|
' Use a stock emoticon or create a custom emoticon'
|
||||||
' <a href="' + helpers.anon_url('https://www.hipchat.com/emoticons/') + '" target="_blank">here</a>.',
|
' <a href="' + helpers.anon_url('https://www.hipchat.com/emoticons/') + '" target="_blank">here</a>.',
|
||||||
'input_type': 'text'
|
'input_type': 'text'
|
||||||
},
|
},
|
||||||
{'label': 'Include Subject as "From"',
|
|
||||||
'value': self.from_subject,
|
|
||||||
'name': 'hipchat_from_subject',
|
|
||||||
'description': 'Include the subject line in the Hipchat "From" field, which appears on the top line above the message.',
|
|
||||||
'input_type': 'checkbox'
|
|
||||||
},
|
|
||||||
{'label': 'Include Poster',
|
{'label': 'Include Poster',
|
||||||
'value': self.incl_poster,
|
'value': self.incl_poster,
|
||||||
'name': 'hipchat_incl_poster',
|
'name': 'hipchat_incl_poster',
|
||||||
|
@ -2880,7 +2869,7 @@ class HIPCHAT(object):
|
||||||
{'label': 'Include Subject Line',
|
{'label': 'Include Subject Line',
|
||||||
'value': self.incl_subject,
|
'value': self.incl_subject,
|
||||||
'name': 'hipchat_incl_subject',
|
'name': 'hipchat_incl_subject',
|
||||||
'description': 'Include the subject line with the notifications.',
|
'description': 'Includes the subject with the notifications.',
|
||||||
'input_type': 'checkbox'
|
'input_type': 'checkbox'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue