mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Decode script args before formatting
This commit is contained in:
parent
427201a4ce
commit
6be5397a2d
1 changed files with 2 additions and 2 deletions
|
@ -1048,7 +1048,7 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None,
|
||||||
|
|
||||||
if agent_id == 15:
|
if agent_id == 15:
|
||||||
try:
|
try:
|
||||||
script_args = [custom_formatter.format(arg, **parameters).decode(plexpy.SYS_ENCODING, 'ignore')
|
script_args = [custom_formatter.format(arg.decode(plexpy.SYS_ENCODING, 'ignore'), **parameters)
|
||||||
for arg in shlex.split(subject.encode(plexpy.SYS_ENCODING, 'ignore'))]
|
for arg in shlex.split(subject.encode(plexpy.SYS_ENCODING, 'ignore'))]
|
||||||
except LookupError as e:
|
except LookupError as e:
|
||||||
logger.error(u"Tautulli NotificationHandler :: Unable to parse parameter %s in script argument. Using fallback." % e)
|
logger.error(u"Tautulli NotificationHandler :: Unable to parse parameter %s in script argument. Using fallback." % e)
|
||||||
|
@ -1068,7 +1068,7 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None,
|
||||||
if body:
|
if body:
|
||||||
def str_format(s):
|
def str_format(s):
|
||||||
if isinstance(s, basestring):
|
if isinstance(s, basestring):
|
||||||
return custom_formatter.format(s, **parameters).decode(plexpy.SYS_ENCODING, 'ignore')
|
return custom_formatter.format(unicode(s), **parameters)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue