PROGRAMMECONTENTTESTS
The tests for programme content match against particular attributes or subelements of the <programme>
element in the XML data. Each test is named the same as the attribute or element it matches. Those
which take a regexp as an argument match if the programme contains at least one attribute or element of
the same name whose content matches the regexp. Those which do not take a regexp match if the programme
simply contains one or more attributes or elements of that name.
Some elements may or may not have content - they may just be empty. The regular expression '' (the empty
string) matches any element, even one with empty content, while a nonempty regular expression matches
only those with content.
For example, --descRacing matches a programme if the programme has at least one <desc> element whose
content contains 'Racing'. --stop'' (the second argument is the empty string) matches a programme if
the programme gives a stop time.
There are some elements where only yes/no matching is possible, where you cannot give a regexp to query
the element's content. For these the second '' argument is mandatory. For example --previously-shown''
will match programmes which have that element, but a test of --previously-shownfoo will give an error
because querying the content of previously-shown is not implemented. The additional empty-string
argument is to leave room for future expansion.
The content tests are generated from the XMLTV file format. The current set of programme content tests
is:
--audio ''
--category REGEXP
--channel REGEXP
--clumpidx REGEXP
--country REGEXP
--credits ''
--date REGEXP
--desc REGEXP
--episode-num ''
--icon ''
--image ''
--keyword REGEXP
--language REGEXP
--last-chance REGEXP
--length ''
--new--orig-language REGEXP
--pdc-start REGEXP
--premiere REGEXP
--previously-shown ''
--rating ''
--review ''
--showview REGEXP
--star-rating ''
--start REGEXP
--stop REGEXP
--sub-title REGEXP
--subtitles ''
--title REGEXP
--url ''
--video ''
--videoplus REGEXP
--vps-start REGEXP
While every attribute and subelement of <programme> elements is included in the above list, for some of
them it is normally more convenient to use the special tests described below.
CHANNELTESTS
There are three tests for channels. These filter both <programme> and <channel> elements: if a channel
is filtered out then all programmes on that channel are too.
--channel-nameREGEXP True if the channel has a <name> whose content matches REGEXP.
--channel-idCHANNEL_ID True if the channel's XMLTV id is exactly equal to CHANNEL_ID.
--channel-id-expREGEXP True if the channel has a <id> whose content matches REGEXP.
TIMETESTS
Normally you don't want to test time strings with a regular expression but rather compare them with some
other time. There are two tests for this.
--on-afterDATE True if the programme will be broadcast at or after DATE, or will be part of the way
through broadcasting at DATE. (Note: a programme is considered to be broadcasting from its start time,
up to but not including its stop time.) DATE can be given in any sane date format; but if you don't
specify the timezone then UTC is assumed. To remove all the programmes you have already missed, try
--on-afternow.
--on-beforeDATE True if the programme will be broadcast wholly before DATE, or if it will be part of the
way through broadcasting at DATE. To remove all the programmes that haven't yet begun broadcasting, try
--on-beforenow. You can use --on-before and --on-after together to find all programmes which are
broadcasting at a certain time.
Another way of thinking about these two tests is that --on-afternow gives 'all programmes you could
possibly still watch, although perhaps only catching the end'. --on-beforenow gives 'all programmes you
could possibly have seen, even if only the start'.
--evalCODE Evaluate CODE as Perl code, use the return value to decide whether to keep the programme.
The Perl code will be given the programme data in $_ in XMLTV.pm hash format (see XMLTV). The code can
actually modify the programme passed in, which can be used for quick fixups. This option is not intended
for normal use, but as an escape in case none of the existing tests is what you want. If you develop any
useful bits of code, please submit them to be included as new tests.
LOGICALOPERATORSEXPR1--andEXPR2, EXPR1-andEXPR2, EXPR1EXPR2EXPR1--orEXPR2, EXPR1-orEXPR2--notEXPR, -notEXPR, !EXPR
Of these, 'not' binds tightest, affecting the following predicate only. 'and' is next, and 'or' binds
loosest.