# Allow setting some defaults for the output blocks.
my %defaults = (
'schedule' => {
- 'attrs' => [ qw/title startTime NODE_TEXT subTitle/ ],
+ 'attrs' => [ qw/title startTime NODE_TEXT subTitle .\/Channel[@channelName]:channelName/ ],
'template' => "__startTime__ - __title__"
. (defined $episode ? " - __subTitle__" : '')
+ . " (__channelName__)"
. (defined $description ? "\n__NODE_TEXT__" : ''),
'filter' => {
# Only show recordings for today and tomorrow.
'type' => 'xpath',
'xpath' => "//Status/Encoders/Encoder/Program",
'hide' => 'after',
- 'attrs' => [ qw/title endTime/ ],
- 'template' => "__title__ (Ends: __endTime__)",
+ 'attrs' => [ qw/title endTime .\/Channel[@channelName]:channelName/ ],
+ 'template' => "__title__ (__channelName__) Ends: __endTime__",
'rewrite' => {
'/endTime/' => { '.*T' => '' },
},
for my $item (@{ $items }) {
my %vars;
for my $key (@{ $block->{'attrs'} }) {
- $vars{$key} = $key eq 'NODE_TEXT' ? $item->string_value : $item->getAttribute($key);
+ if ($key =~ /(.*?):(.*)/) {
+ my $subitem = $item->findnodes($1);
+ $vars{$2} = @{ $subitem }[0]->getAttribute($2)
+ if defined @{ $subitem }[0];
+ } else {
+ $vars{$key} = $key eq 'NODE_TEXT' ? $item->string_value : $item->getAttribute($key);
+ }
}
my $str = substitute_vars($block, \%vars);