epgsearchuservars.conf(5)

NAME
epgsearchuservars.conf – user-defined variables

DESCRIPTION
This file defines variables that can be used in EPGSearch wherever variables are applicable. This, for example, applies for the default recording directory of a manually created timer, the recording directory of a search timer, or a customized EPG menu.

SYNTAX
A variable has the syntax '%VariableName%'. Its name can comprise all alphanumeric characters, but no spaces or other special characters.

Examples for possible names:

    %Series%
    %DocuVar1%
    %ThemesSubtitleDate%

Variable names are case-insensitive.

  Assignment
Variables always get assigned strings whose spaces are retained. This is illustrated by the following examples:

    %Series%=New series~Thrillers

The variable '%Series%' will be assigned the string "New series~Thrillers". This can be used arbitrarily:

    %Path%=%Series%

The variable '%Path%' gets the content of the variable '%Series%' assigned.

    %Path%=%Series%~Lost

The variable '%Path%' contains the string "New series~Thrillers~Lost".

  Conditional assignment
Simple if-then-else constructs for assignments are supported by means of conditional expressions 'if ? then : else'. Conditional expressions cannot contain strings, only variables; spaces are ignored.

    %Foo%=Other
    %Variable%=%Path% ? %Path% : %Foo%

For the ternary operator '?:', the expression '%Path% ?' means "path not empty?". If this is true, '%Variable%' gets assigned the content of '%Path%', else the content of '%Foo%'.

Other checks are supported as well:

    == equal
    != not equal

Thus, for example:

    %Variable%=%Path%!=5 ? %Path% : %Foo%

The condition '%Path%!=5 ?' means "is '%Path%' not equal 5?".

Comparing variables is also feasible:

    %Five%=5
    %Variable%=%Path%!=%Five% ? %Path% : %Foo%

  Calling a system command
External commands can be called during variable evaluation as well. The returned string will be assigned to the respective variable:

    %UserVar%=system(<script-name>[, <parameters>])

Calls the script script-name with the parameters supplied in the optional list 'parameters'. Such a parameter can be an arbitrary expression, optionally containing other variables, but no system call or conditional expression.

Example:

    %Result%=system(/usr/local/bin/my-script.sh, -t %Title% -s %Subtitle% -u %MyOtherVar%)

Variables used as parameters will be enclosed in single quotes (apostrophes), if needed.

The script should return a string without line feeds, since their removal may cause undesired results. If the script does not return anything, an empty string will be assigned to the variable '%Result%'.

  Calling a TCP service
A TCP service can be called with the following syntax:

    %Result%=connect(<address>, <port>, [<data>])

This will connect to 'address' through the given 'port' and pass the optional 'data'. The parameter 'address' can be an IP address or the domain name of a TCP service. The result returned by the service must be terminated with a line feed.

  Getting the length of an argument
When passing values to the connect or system command, it can be helpful to have the length of an argument for simple parsing. The length can be retrieved by:

    %Result%=length(<any arguments>)

Example:

    %TitleLength%=length(%title%)

  Other variables
Refer to epgsearchmenu.conf(5) for a list of built-in variables. Furthermore, every variable defined in epgsearchcats.conf can be used; see epgsearchcats.conf(5) for details.

Example
    # Weekday, Date, Time
    %DateStr%=%time_w% %date% %time%

    # Themes or Subtitle or Date
    %SubtitleDate%=%Subtitle% ? %Subtitle% : %DateStr%
    %ThemesSubtitleDate%=%Themes% ? %Themes% : %SubtitleDate%

    # Calls a script to get a recording path
    %DocuScript%=system(docu.pl, -t %Title% -s %Subtitle% -e %Episode% -th %Themes% -c %Category% -g %Genre%)
    %Docu%=%DocuScript%

AUTHORS (man pages)
Originally provided by Mike Constabel <epgsearch (at) constabel (dot) net>.

Revised and adapted to recent plugin features by the current maintainers.

PROJECT SITE
The plugin is maintained as GitHub project:

<https://github.com/vdr-projects/vdr-plugin-epgsearch/>

REPORTING BUGS
Issues can be reported, and features be suggested, through the project's bug tracker:

<https://github.com/vdr-projects/vdr-plugin-epgsearch/issues/>

COPYRIGHT and LICENSE
Copyright (C) 2004-2010 Christian Wieninger

Copyright © 2011-2025 TomJoad (VDR-Portal), et al.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Or, point your browser to <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>

The original author can be reached via cwieninger@gmx.de.

Current maintainers can be reached via the project's GitHub site (see above).

The MD5 code has been derived from the MD5 Message-Digest Algorithm of RSA Data Security, Inc.

SEE ALSO
epgsearch(1), epgsearch(4), epgsearchcats.conf(5), epgsearchmenu.conf(5)