mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-13 08:42:59 -07:00
Add documentation for notification text expressions
This commit is contained in:
parent
93ed5c5eb8
commit
45879d0049
1 changed files with 26 additions and 0 deletions
|
@ -1911,6 +1911,31 @@
|
||||||
<pre>{rating} -->
|
<pre>{rating} -->
|
||||||
Rating: {rating}/10 --> Rating: /10
|
Rating: {rating}/10 --> Rating: /10
|
||||||
{Rating: <rating>/10} --> </pre>
|
{Rating: <rating>/10} --> </pre>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h4>Expressions</h4>
|
||||||
|
</div>
|
||||||
|
<div style="padding-bottom: 10px;">
|
||||||
|
<p class="help-block">
|
||||||
|
Note: <span class="inline-pre">notify_text_eval = 1</span> 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.
|
||||||
|
</p>
|
||||||
|
<p class="help-block">
|
||||||
|
Notification parameters can be wrapped with backticks <span class="inline-pre">`expr`</span> to be evaluated as Python expressions.
|
||||||
|
Only the following functions are supported in expressions:
|
||||||
|
</p>
|
||||||
|
<ul class="help-block">
|
||||||
|
<li><span class="inline-pre">bool(x)</span></li>
|
||||||
|
<li><span class="inline-pre">divmod(a, b)</span></li>
|
||||||
|
<li><span class="inline-pre">float(x)</span></li>
|
||||||
|
<li><span class="inline-pre">int(x)</span></li>
|
||||||
|
<li><span class="inline-pre">round(n[, ndigits])</span></li>
|
||||||
|
<li><span class="inline-pre">str(x)</span></li>
|
||||||
|
</ul>
|
||||||
|
<p><strong style="color: #fff;">Example:</strong></p>
|
||||||
|
<pre>{`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</pre>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h4>Combined</h4>
|
<h4>Combined</h4>
|
||||||
|
@ -1921,6 +1946,7 @@ Rating: {rating}/10 --> Rating: /10
|
||||||
</p>
|
</p>
|
||||||
<ol class="help-block">
|
<ol class="help-block">
|
||||||
<li>Prefix</li>
|
<li>Prefix</li>
|
||||||
|
<li>Evaluation</li>
|
||||||
<li>Parameter</li>
|
<li>Parameter</li>
|
||||||
<li>Case Modifier</li>
|
<li>Case Modifier</li>
|
||||||
<li>List Slicing</li>
|
<li>List Slicing</li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue