VDRadmin-am-3.4.7 simple patch
Commit Message
Hullo,
Andreas: great work on vdradmin-am, I use it daily, thanks. Attached is
a small patch for something I find useful. It shows rec image in EPG
titles that are already scheduled for recording so you don't
accidentally timer them twice. I'm sure it could be done better by
someone who knows what he's doing but it works for me. Feel free to add
this to your releases if you like.
Comments
Hi Marko,
thanks for the patch!
Showing the recording status in every EPG view was planned for one of the
next releases (after the epgsearch integration has been released).
At a first glance your patch looks almost the way I planned to do it, but I
think it needs some investigation in performance optimisation.
Regards,
Andreas
On Monday 09 October 2006 22:25, Marko Kenttälä wrote:
> Hullo,
>
> Andreas: great work on vdradmin-am, I use it daily, thanks. Attached is
> a small patch for something I find useful. It shows rec image in EPG
> titles that are already scheduled for recording so you don't
> accidentally timer them twice. I'm sure it could be done better by
> someone who knows what he's doing but it works for me. Feel free to add
> this to your releases if you like.
@@ -67,11 +67,12 @@
<td class="col_duration">
<a id="<?% bc.anchor %?>" name="<?% bc.anchor %?>"><?% bc.emit %?> - <?% bc.duration %?></a>
</td>
- <td class="col_title">
+ <td class="col_name">
<div class="epg_title">
<?% IF bc.infurl %?>
<a href="javascript:popup('<?% bc.infurl %?>');" title="<?% gettext('More Information') %?>">
<?% END %?>
+ <?% IF bc.recording %?><img src="bilder/rec.gif"> <?% END %?>
<?% bc.title %?>
<?% IF bc.infurl %?>
</a>
@@ -61,11 +61,12 @@
<td class="col_duration">
<a name="<?% bc.anchor %?>"><?% bc.emit %?> - <?% bc.duration %?></a>
</td>
- <td class="col_title">
+ <td class="col_name">
<div class="epg_title">
<?% IF bc.infurl %?>
<a href="javascript:popup('<?% bc.infurl %?>');" title="<?% gettext('More Information') %?>">
<?% END %?>
+ <?% IF bc.recording %?><img ali\gn="middle" src="bilder/rec.gif" border="0" alt="" /> <?% END %?>
<?% bc.title %?>
<?% IF bc.infurl %?>
</a>
@@ -2559,6 +2559,7 @@
#
my (@show, $progname, $cnumber);
my $day = 0;
+ my @timers = ParseTimer(0);
for my $event (@{ $EPG{$vdr_id} }) {
if (my_strftime("%d", $event->{start}) != $day) {
@@ -2576,6 +2577,14 @@
}
my $imdb_title = $event->{title};
$imdb_title =~ s/^.*\~\%*([^\~]*)$/$1/;
+ my $recording=0;
+ # go through timers to see if this event is recorded
+ foreach my $t (@timers) {
+ if ($event->{channel_name} eq $t->{cdesc} && $event->{start} > $t->{start} && $event->{stop} < $t->{stop}) {
+ $recording=1;
+ last;
+ }
+ }
push(@show,
{ ssse => $event->{start},
emit => my_strftime("%H:%M", $event->{start}),
@@ -2587,7 +2596,9 @@
find_title => uri_escape("/^" . quotemeta($event->{title} . "~" . ($event->{subtitle} ? $event->{subtitle} : "") . "~") . "/i"),
imdburl => "http://akas.imdb.com/Tsearch?title=" . uri_escape($imdb_title),
newd => 0,
- anchor => "id" . $event->{event_id}
+ anchor => "id" . $event->{event_id},
+ # new recording flag
+ recording=> $recording
}
);
$progname = $event->{progname};
@@ -2658,6 +2669,7 @@
my $border;
$border = timelocal(0, $minute, $hour, substr($day, 6, 2), substr($day, 4, 2) - 1, substr($day, 0, 4)) if($day);
my $time = getStartTime($param_time ? $param_time : undef, undef, $border);
+ my @timers=ParseTimer(0);
foreach (@channel) { # loop through all channels
$vdr_id = $_->{vdr_id};
@@ -2685,7 +2697,14 @@
$last_day = $event_day_long if ($event_day_long > $last_day);
$dayflag = 0;
}
-
+ my $recording=0;
+ # go through timers to see if this event is recorded
+ foreach my $t (@timers) {
+ if ($event->{channel_name} eq $t->{cdesc} && $event->{start} > $t->{start} && $event->{stop} < $t->{stop}) {
+ $recording=1;
+ last;
+ }
+ }
if ($dayflag == 1 && $time < $event->{stop}) {
push(@show,
{ channel_name => $event->{channel_name},
@@ -2693,7 +2712,8 @@
newd => 1,
streamurl => $FEATURES{STREAMDEV} ? $MyStreamBase . $CONFIG{TV_EXT} . "?aktion=live_stream&channel=" . $event->{vdr_id} : undef,
switchurl => "$MyURL?aktion=prog_switch&channel=" . $event->{vdr_id},
- proglink => "$MyURL?aktion=prog_list&vdr_id=" . $event->{vdr_id}
+ proglink => "$MyURL?aktion=prog_list&vdr_id=" . $event->{vdr_id},
+ recording => $recording
}
);
@@ -2714,7 +2734,8 @@
find_title => uri_escape("/^" . quotemeta($event->{title} . "~" . ($event->{subtitle} ? $event->{subtitle} : "") . "~") . "/i"),
imdburl => "http://akas.imdb.com/Tsearch?title=" . uri_escape($imdb_title),
newd => 0,
- anchor => "id" . $event->{event_id}
+ anchor => "id" . $event->{event_id},
+ recording=> $recording
}
);
$progname = $event->{progname};