# Conflicts
{
'name' => 'Schedule Conflicts',
- 'type' => 'Perl MythTV API',
+ 'type' => 'sub',
'defaults' => 'schedule',
+ 'sub' => \&process_conflicts
},
# How many hours till the next recording.
$output = process_xml($block, $xml);
- } elsif ($block->{'type'} eq 'Perl MythTV API') {
- $myth ||= load_perl_api();
+ } elsif ($block->{'type'} eq 'sub') {
- $output = process_perl($block, $myth);
+ $output = &{ $block->{'sub'} }($block)
+ if defined $block->{'sub'};
} elsif ($block->{'type'} eq 'sub') {
$output = substitute_vars($block, { 'next_time' => $next_time });
return join("\n", @lines);
}
-sub process_perl {
- my ($block, $myth) = @_;
+sub process_conflicts {
+ my ($block) = @_;
+ $myth ||= load_perl_api();
return "Unable to access MythTV Perl API."
unless defined $myth;