[Slim-Checkins] r8785 - in /trunk/server: Changelog6.html Slim/Web/Pages/Search.pm

dsully at svn.slimdevices.com dsully at svn.slimdevices.com
Thu Aug 3 17:59:03 PDT 2006


Author: dsully
Date: Thu Aug  3 17:59:02 2006
New Revision: 8785

URL: http://svn.slimdevices.com?rev=8785&view=rev
Log:
Bug: 3861
Description: No pagebar for advanced search.

Modified:
    trunk/server/Changelog6.html
    trunk/server/Slim/Web/Pages/Search.pm

Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=8785&r1=8784&r2=8785&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Thu Aug  3 17:59:02 2006
@@ -462,6 +462,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3850">#3850</a> - Some cover art is not resized for gallery view thumbnails</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3853">#3853</a> - playing genre favorite plays songs in track order</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3859">#3859</a> - genre favorites play via player, but not via web interface</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3861">#3861</a> - Search crashes slimserver</li>
 	</ul>
 </ul>
 

Modified: trunk/server/Slim/Web/Pages/Search.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Web/Pages/Search.pm?rev=8785&r1=8784&r2=8785&view=diff
==============================================================================
--- trunk/server/Slim/Web/Pages/Search.pm (original)
+++ trunk/server/Slim/Web/Pages/Search.pm Thu Aug  3 17:59:02 2006
@@ -268,7 +268,7 @@
 }
 
 sub fillInSearchResults {
-	my ($params, $rs, $qstring, $typeSeparator) = @_;
+	my ($params, $rs, $qstring, $advancedSearch) = @_;
 
 	my $player = $params->{'player'};
 	my $query  = $params->{'query'}  || '';
@@ -287,7 +287,7 @@
 			  join('&', @$qstring);
 
 	# Put in the type separator
-	if (!$typeSeparator && $count) {
+	if (!$advancedSearch && $count) {
 
 		# add reduced item for type headings
 		push @{$params->{'browse_items'}}, {
@@ -303,7 +303,7 @@
 
 		my $attributes = '';
 
-		if ($typeSeparator) {
+		if ($advancedSearch) {
 			$attributes = sprintf('&searchRef=search%sResults', ucfirst($type));
 		} else {
 			$attributes = sprintf('&%s.%s=%s', $type, $rs->searchColumn, $query);
@@ -317,26 +317,30 @@
 		};
 	}
 
-	my $offset = ($params->{'start'} || 0),
-	my $limit  = ($params->{'itemsPerPage'} || 10) - 1;
-
-	$params->{'pageinfo'} = Slim::Web::Pages->pageInfo({
-
-		'itemCount'    => $params->{'numresults'},
-		'path'         => $params->{'path'},
-		'otherParams'  => $otherParams,
-		'start'        => $params->{'start'},
-		'perPage'      => $params->{'itemsPerPage'},
-	});
-
-	$params->{'start'} = $params->{'pageinfo'}{'startitem'};
+	# No limit or pagebar on advanced search
+	if (!$advancedSearch) {
+
+		my $offset = ($params->{'start'} || 0),
+		my $limit  = ($params->{'itemsPerPage'} || 10) - 1;
+
+		$params->{'pageinfo'} = Slim::Web::Pages->pageInfo({
+
+			'itemCount'    => $params->{'numresults'},
+			'path'         => $params->{'path'},
+			'otherParams'  => $otherParams,
+			'start'        => $params->{'start'},
+			'perPage'      => $params->{'itemsPerPage'},
+		});
+
+		$params->{'start'} = $params->{'pageinfo'}{'startitem'};
 	
+		# Get just the items we need for this loop.
+		$rs = $rs->slice($offset, $limit);
+	}
+
 	my $itemCount  = 1;
 	my $lastAnchor = '';
 	my $descend    = $type eq 'track' ? 0 : 1;
-
-	# Get just the items we need for this loop.
-	$rs = $rs->slice($offset, $limit);
 
 	# This is very similar to a loop in Slim::Web::Pages::BrowseDB....
 	while (my $obj = $rs->next) {



More information about the checkins mailing list