From patchwork Mon Oct 9 20:25:33 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marko_Kentt=C3=A4l=C3=A4?= X-Patchwork-Id: 12398 Received: from fep32-0.kolumbus.fi ([193.229.0.63] helo=fep32-app.kolumbus.fi) by www.linuxtv.org with esmtp (Exim 4.50) id 1GX1gG-0008Km-8q for vdr@linuxtv.org; Mon, 09 Oct 2006 22:24:56 +0200 Received: from [192.168.1.2] (really [81.197.5.247]) by fep32-app.kolumbus.fi with ESMTP id <20061009202454.TFAY28892.fep32-app.kolumbus.fi@[192.168.1.2]> for ; Mon, 9 Oct 2006 23:24:54 +0300 Message-ID: <452AB03D.6000203@tut.fi> Date: Mon, 09 Oct 2006 23:25:33 +0300 From: =?ISO-8859-1?Q?Marko_Kentt=E4l=E4?= User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: vdr@linuxtv.org Subject: [vdr] VDRadmin-am-3.4.7 simple patch X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2006 20:24:56 -0000 Status: O X-Status: X-Keywords: X-UID: 10872 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. diff -ru /tmp/vdradmin-am-3.4.7/template/default/prog_list2.html ./template/default/prog_list2.html --- /tmp/vdradmin-am-3.4.7/template/default/prog_list2.html 2006-08-31 14:51:38.000000000 +0300 +++ ./template/default/prog_list2.html 2006-10-09 22:48:42.000000000 +0300 @@ -67,11 +67,12 @@ - - +
+   diff -ru /tmp/vdradmin-am-3.4.7/template/default/prog_list.html ./template/default/prog_list.html --- /tmp/vdradmin-am-3.4.7/template/default/prog_list.html 2006-08-31 14:48:46.000000000 +0300 +++ ./template/default/prog_list.html 2006-10-09 22:28:19.000000000 +0300 @@ -61,11 +61,12 @@ - - +
+   diff -ru /tmp/vdradmin-am-3.4.7/vdradmind.pl ./vdradmind.pl --- /tmp/vdradmin-am-3.4.7/vdradmind.pl 2006-09-29 12:02:29.000000000 +0300 +++ ./vdradmind.pl 2006-10-09 21:50:15.000000000 +0300 @@ -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};