Difference between revisions of "Vdradmin-initial-lookup-patch"

From VDR Wiki
Jump to: navigation, search
 
(Patch: patch for vdradmin-am)
Line 20: Line 20:
   
 
==Patch==
 
==Patch==
  +
Version for vdradmin:
  +
 
<pre>
 
<pre>
 
diff -Nur vdradmin-0.97-am3.4.2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html vdradmin-0.97-am3.4.2-biglist2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html
 
diff -Nur vdradmin-0.97-am3.4.2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html vdradmin-0.97-am3.4.2-biglist2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html
Line 130: Line 132:
 
url => $MyURL
 
url => $MyURL
 
};
 
};
  +
</pre>
  +
  +
Version for vdradmin-am:
  +
  +
<pre>
  +
diff -Nur vdradmin-am-3.4.4/template/default/prog_summary.html vdradmin-am-3.4.4-biglist/template/default/prog_summary.html
  +
--- vdradmin-am-3.4.4/template/default/prog_summary.html
  +
+++ vdradmin-am-3.4.4-biglist/template/default/prog_summary.html
  +
@@ -23,7 +23,7 @@
  +
<td class="col_other">
  +
<%! What's on: !%>&nbsp;<a href="<tmpl_var nowurl>"><%! now !%></a>&nbsp;|<%! at: !%>&nbsp;
  +
<input type="text" name="time" size="5" value="<tmpl_var now>" />
  +
- &nbsp;<%! o'clock !%>
  +
+
  +
</td>
  +
<td class="col_right"></td>
  +
</tr>
  +
diff -Nur vdradmin-am-3.4.4/vdradmind.pl vdradmin-am-3.4.4-biglist/vdradmind.pl
  +
--- vdradmin-am-3.4.4/vdradmind.pl
  +
+++ vdradmin-am-3.4.4-biglist/vdradmind.pl
  +
@@ -2514,6 +2514,8 @@
  +
my $last_day = 0;
  +
my $day = $current_day;
  +
$day = $q->param("day") if ($q->param("day"));
  +
+ my $prefix = 'a';
  +
+ $prefix = $q->param("prefix") if ($q->param("prefix"));
  +
  +
#
  +
my $vdr_id;
  +
@@ -2531,7 +2533,8 @@
  +
}
  +
  +
# skip channels without EPG data
  +
- if(ChannelHasEPG($channel->{vdr_id})) {
  +
+ if(ChannelHasEPG($channel->{vdr_id})
  +
+ &&$channel->{name}=~/^$prefix/i) {
  +
push(@channel, {
  +
name => $channel->{name},
  +
vdr_id => $channel->{vdr_id},
  +
@@ -2600,8 +2603,13 @@
  +
  +
#
  +
my($template) = TemplateNew("prog_list2.html");
  +
+ my $switcher="<a href='vdradmin.pl?aktion=prog_list2&prefix=%5B%5Ea%2Dz%5D'>#</a> ";
  +
+ foreach(('a','b','c','d','e','f','g','h','i','j','k','l','m',
  +
+ 'n','o','p','q','r','s','t','u','v','w','x','y','z')) {
  +
+ $switcher.="<a href='vdradmin.pl?aktion=prog_list2&prefix=$_'>$_</a> ";
  +
+ }
  +
my $vars = {
  +
- title => $day == $current_day ? gettext("Playing Today") : ($day == $current_day + 1 ? gettext("Playing Tomorrow") : sprintf(gettext("Playing on the %d."), $day)),
  +
+ title => ($day == $current_day ? gettext("Playing Today") : ($day == $current_day + 1 ? gettext("Playing Tomorrow") : sprintf(gettext("Playing on the %d."), $day)))." $switcher",
  +
usercss => $UserCSS,
  +
url => $MyURL,
  +
loop => \@show,
  +
@@ -3792,6 +3800,9 @@
  +
return if(UptoDate());
  +
my $time = $q->param("time");
  +
my $search = $q->param("search");
  +
+ my $prefix = 'a';
  +
+ $prefix = '' if ($q->param("search"));
  +
+ $prefix = $q->param("prefix") if ($q->param("prefix"));
  +
  +
# zeitpunkt bestimmen
  +
my $event_time;
  +
@@ -3899,7 +3910,9 @@
  +
$displaysubtitle =~ s/\|/<br \/>\n/g;
  +
}
  +
my $myself = Encode_Referer($MyURL . "?" . $Query);
  +
- push(@show, {
  +
+ if ($event->{channel_name}=~/^$prefix/i)
  +
+ {
  +
+ push(@show, {
  +
date => my_strftime("%x", $event->{start}),
  +
longdate => my_strftime("%A, %x", $event->{start}),
  +
start => my_strftime("%H:%M", $event->{start}),
  +
@@ -3919,6 +3932,7 @@
  +
anchor => "id" . $event->{event_id}
  +
});
  +
last if(!$search);
  +
+ }
  +
}
  +
}
  +
  +
@@ -3939,11 +3953,17 @@
  +
}
  +
  +
#
  +
+ my $switcher="<a href='vdradmin.pl?aktion=prog_list2&prefix=%5B%5Ea%2Dz%5D'>#</a> ";
  +
+ foreach(('a','b','c','d','e','f','g','h','i','j','k','l','m',
  +
+ 'n','o','p','q','r','s','t','u','v','w','x','y','z')) {
  +
+ $switcher.="<a href='vdradmin.pl?aktion=prog_summary&prefix=$_'>$_</a> ";
  +
+ }
  +
my $template = TemplateNew("prog_summary.html");
  +
my $vars = {
  +
usercss => $UserCSS,
  +
rows => \@shows,
  +
- now => strftime("%H:%M", localtime($event_time)),
  +
+ now => strftime("%H:%M", localtime($event_time))
  +
+ ."&nbsp;o'clock $switcher",
  +
title => $search ? gettext("Suitable matches for:") . " " . $search : strftime("%H:%M", localtime($event_time)) . " " . gettext("o'clock"),
  +
nowurl => $MyURL . "?aktion=prog_summary",
  +
url => $MyURL
 
</pre>
 
</pre>
   

Revision as of 15:12, 19 May 2006

Description

When using the big summary pages of VDRadmin on a big channels.conf list, loading takes a while and it needs quite some resources. This patch enables categorizing the channels by initial letters.

Hardware requirements

Software requirements

  • patch
  • vdradmin

Installation

You can install it with

cd $SOURCEDIR/vdradmin
patch -p 1 < /path/to/patch

Note, VDRadmin has to be reinstalled now.

Problems

Patch

Version for vdradmin:

diff -Nur vdradmin-0.97-am3.4.2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html vdradmin-0.97-am3.4.2-biglist2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html
--- vdradmin-0.97-am3.4.2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html
+++ vdradmin-0.97-am3.4.2-biglist2/debian/vdradmin/usr/share/vdradmin/template/default/prog_summary.html
@@ -18,7 +18,7 @@
 			<tr>
 				<td class="col_left"></td>
 				<td class="col_title">
-					<h1><tmpl_var now> <%! o'clock !%></h1>
+					<h1><tmpl_var now><%! !%></h1>
 				</td>
 				<td class="col_other">
 					<%! What's on: !%> <a href="<tmpl_var nowurl>"><%! now !%></a> |<%! at: !%> 
diff -Nur vdradmin-0.97-am3.4.2/template/default/prog_summary.html vdradmin-0.97-am3.4.2-biglist2/template/default/prog_summary.html
--- vdradmin-0.97-am3.4.2/template/default/prog_summary.html
+++ vdradmin-0.97-am3.4.2-biglist2/template/default/prog_summary.html
@@ -18,7 +18,7 @@
 			<tr>
 				<td class="col_left"></td>
 				<td class="col_title">
-					<h1><tmpl_var now> <%! o'clock !%></h1>
+					<h1><tmpl_var now></h1>
 				</td>
 				<td class="col_other">
 					<%! What's on: !%> <a href="<tmpl_var nowurl>"><%! now !%></a> |<%! at: !%> 
diff -Nur vdradmin-0.97-am3.4.2/vdradmind.pl vdradmin-0.97-am3.4.2-biglist2/vdradmind.pl
--- vdradmin-0.97-am3.4.2/vdradmind.pl
+++ vdradmin-0.97-am3.4.2-biglist2/vdradmind.pl
@@ -2418,6 +2418,8 @@
 	my $last_day = 0;
 	my $day = $current_day;
 	$day = $q->param("day") if ($q->param("day"));
+	my $prefix = 'a';
+	$prefix = $q->param("prefix") if ($q->param("prefix"));
 
 	#
   my $vdr_id;
@@ -2434,7 +2436,8 @@
     } 
     
     # skip channels without EPG data
-		if(ChannelHasEPG($channel->{vdr_id})) {
+		if(ChannelHasEPG($channel->{vdr_id})
+				&&$channel->{name}=~/^$prefix/i) {
 			push(@channel, {
 				name       => $channel->{name},
 				vdr_id     => $channel->{vdr_id},
@@ -2504,8 +2507,13 @@
 	
   # 
   my($template) = TemplateNew("prog_list2.html");
+  my $switcher="<a href='vdradmin.pl?aktion=prog_list2&prefix=%5B%5Ea%2Dz%5D'>#</a> ";
+  foreach(('a','b','c','d','e','f','g','h','i','j','k','l','m',
+  	   'n','o','p','q','r','s','t','u','v','w','x','y','z')) {
+	$switcher.="<a href='vdradmin.pl?aktion=prog_list2&prefix=$_'>$_</a> ";
+  }
   my $vars = {
-		title          => $day == $current_day ? gettext("Playing Today") : ($day == $current_day + 1 ? gettext("Playing Tomorrow") : sprintf(gettext("Playing on the %d."), $day)),
+		title          => ($day == $current_day ? gettext("Playing Today") : ($day == $current_day + 1 ? gettext("Playing Tomorrow") : sprintf(gettext("Playing on the %d."), $day)))." $switcher",
 		usercss        => $UserCSS,
     url            => $MyURL,
     loop           => \@show,
@@ -3686,6 +3694,9 @@
   return if(UptoDate());
   my $time = $q->param("time");
   my $search = $q->param("search");
+  my $prefix = 'a';
+  $prefix = '' if ($q->param("search"));
+  $prefix = $q->param("prefix") if ($q->param("prefix"));
 
   # zeitpunkt bestimmen
   my $event_time;
@@ -3762,7 +3773,9 @@
 			$displaytitle =~ s/\|/<br \/>\n/g;
 			$displaysubtitle =~ s/\n/<br \/>\n/g;
 			$displaysubtitle =~ s/\|/<br \/>\n/g;
-      push(@show,  {
+      if ($event->{channel_name}=~/^$prefix/i)
+      {
+	  push(@show,  {
 				date           => my_strftime("%x", $event->{start}),
 				longdate       => my_strftime("%A, %x", $event->{start}),
 				start          => my_strftime("%H:%M", $event->{start}),
@@ -3782,6 +3795,7 @@
         anchor         => "id" . $event->{event_id}
 				});
 				last if(!$search);
+			      }
 			}
 		}
 
@@ -3802,11 +3816,17 @@
 		}
 
 		#
+		my $switcher="<a href='vdradmin.pl?aktion=prog_list2&prefix=%5B%5Ea%2Dz%5D'>#</a> ";
+  foreach(('a','b','c','d','e','f','g','h','i','j','k','l','m',
+  	   'n','o','p','q','r','s','t','u','v','w','x','y','z')) {
+	$switcher.="<a href='vdradmin.pl?aktion=prog_summary&prefix=$_'>$_</a> ";
+  }
 		my $template = TemplateNew("prog_summary.html");
   my $vars = {
 		usercss => $UserCSS,
     rows    => \@shows,
-    now     => strftime("%H:%M", localtime($event_time)),
+    now     => strftime("%H:%M", localtime($event_time))
+	." o'clock $switcher",
     nowurl  => $MyURL . "?aktion=prog_summary",
     url     => $MyURL
   };

Version for vdradmin-am:

diff -Nur vdradmin-am-3.4.4/template/default/prog_summary.html vdradmin-am-3.4.4-biglist/template/default/prog_summary.html
--- vdradmin-am-3.4.4/template/default/prog_summary.html
+++ vdradmin-am-3.4.4-biglist/template/default/prog_summary.html
@@ -23,7 +23,7 @@
 				<td class="col_other">
 					<%! What's on: !%> <a href="<tmpl_var nowurl>"><%! now !%></a> |<%! at: !%> 
 					<input type="text" name="time" size="5" value="<tmpl_var now>" />
-					 <%! o'clock !%>
+				
 				</td>
 				<td class="col_right"></td>
 			</tr>
diff -Nur vdradmin-am-3.4.4/vdradmind.pl vdradmin-am-3.4.4-biglist/vdradmind.pl
--- vdradmin-am-3.4.4/vdradmind.pl
+++ vdradmin-am-3.4.4-biglist/vdradmind.pl
@@ -2514,6 +2514,8 @@
 	my $last_day = 0;
 	my $day = $current_day;
 	$day = $q->param("day") if ($q->param("day"));
+	my $prefix = 'a';
+	$prefix = $q->param("prefix") if ($q->param("prefix"));
 
 	#
   my $vdr_id;
@@ -2531,7 +2533,8 @@
     } 
     
     # skip channels without EPG data
-		if(ChannelHasEPG($channel->{vdr_id})) {
+		if(ChannelHasEPG($channel->{vdr_id})
+				&&$channel->{name}=~/^$prefix/i) {
 			push(@channel, {
 				name       => $channel->{name},
 				vdr_id     => $channel->{vdr_id},
@@ -2600,8 +2603,13 @@
 
   # 
   my($template) = TemplateNew("prog_list2.html");
+  my $switcher="<a href='vdradmin.pl?aktion=prog_list2&prefix=%5B%5Ea%2Dz%5D'>#</a> ";
+  foreach(('a','b','c','d','e','f','g','h','i','j','k','l','m',
+  	   'n','o','p','q','r','s','t','u','v','w','x','y','z')) {
+	$switcher.="<a href='vdradmin.pl?aktion=prog_list2&prefix=$_'>$_</a> ";
+  }
   my $vars = {
-		title          => $day == $current_day ? gettext("Playing Today") : ($day == $current_day + 1 ? gettext("Playing Tomorrow") : sprintf(gettext("Playing on the %d."), $day)),
+		title          => ($day == $current_day ? gettext("Playing Today") : ($day == $current_day + 1 ? gettext("Playing Tomorrow") : sprintf(gettext("Playing on the %d."), $day)))." $switcher",
 		usercss        => $UserCSS,
     url            => $MyURL,
     loop           => \@show,
@@ -3792,6 +3800,9 @@
   return if(UptoDate());
   my $time = $q->param("time");
   my $search = $q->param("search");
+  my $prefix = 'a';
+  $prefix = '' if ($q->param("search"));
+  $prefix = $q->param("prefix") if ($q->param("prefix"));
 
   # zeitpunkt bestimmen
   my $event_time;
@@ -3899,7 +3910,9 @@
 				$displaysubtitle =~ s/\|/<br \/>\n/g;
 			}
 			my $myself = Encode_Referer($MyURL . "?" . $Query);
-      push(@show,  {
+     if ($event->{channel_name}=~/^$prefix/i)
+       {
+	  push(@show,  {
 				date           => my_strftime("%x", $event->{start}),
 				longdate       => my_strftime("%A, %x", $event->{start}),
 				start          => my_strftime("%H:%M", $event->{start}),
@@ -3919,6 +3932,7 @@
         anchor         => "id" . $event->{event_id}
 				});
 				last if(!$search);
+			      }
 			}
 		}
 
@@ -3939,11 +3953,17 @@
 		}
 
 		#
+		my $switcher="<a href='vdradmin.pl?aktion=prog_list2&prefix=%5B%5Ea%2Dz%5D'>#</a> ";
+  foreach(('a','b','c','d','e','f','g','h','i','j','k','l','m',
+  	   'n','o','p','q','r','s','t','u','v','w','x','y','z')) {
+	$switcher.="<a href='vdradmin.pl?aktion=prog_summary&prefix=$_'>$_</a> ";
+  }
 		my $template = TemplateNew("prog_summary.html");
   my $vars = {
 		usercss => $UserCSS,
     rows    => \@shows,
-    now     => strftime("%H:%M", localtime($event_time)),
+    now     => strftime("%H:%M", localtime($event_time))
+	." o'clock $switcher",
 		title   => $search ? gettext("Suitable matches for:") . " " . $search : strftime("%H:%M", localtime($event_time)) . " " . gettext("o'clock"),
     nowurl  => $MyURL . "?aktion=prog_summary",
     url     => $MyURL