From 45879d0049f49a226fcb2b7b8cfe6d02bf4c963c Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Tue, 25 May 2021 12:22:48 -0700 Subject: [PATCH] Add documentation for notification text expressions --- data/interfaces/default/settings.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 9a24e816..618acc6a 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1911,6 +1911,31 @@
{rating}              -->
 Rating: {rating}/10   --> Rating: /10
 {Rating: <rating>/10} --> 
+ +
+

Expressions

+
+
+

+ Note: notify_text_eval = 1 must be manually enabled in the configuration file to enable expressions. + Enabling this setting could pose a security risk. Enable at your own risk. It is recommended to leave this feature disabled if it is not being used. +

+

+ Notification parameters can be wrapped with backticks `expr` to be evaluated as Python expressions. + Only the following functions are supported in expressions: +

+ +

Example:

+
{`float(rating) * 10`>%}                           --> 89%
+{`"%d hr %d min" % divmod(int(duration), 60)`}     --> 1 hr 50 min
+{`round(float(stream_bandwidth) / 1000, 1)`> Mbps} --> 6.9 Mbps

Combined

@@ -1921,6 +1946,7 @@ Rating: {rating}/10 --> Rating: /10

  1. Prefix
  2. +
  3. Evaluation
  4. Parameter
  5. Case Modifier
  6. List Slicing