[Slim-Checkins] r12486 - /trunk/server/Slim/Control/Commands.pm

fred at svn.slimdevices.com fred at svn.slimdevices.com
Sat Aug 4 10:26:35 PDT 2007


Author: fred
Date: Sat Aug  4 10:26:35 2007
New Revision: 12486

URL: http://svn.slimdevices.com?rev=12486&view=rev
Log:
Bug: N/A
Description: Fix sorting issue when playing from Jive, re-use web UI code !


Modified:
    trunk/server/Slim/Control/Commands.pm

Modified: trunk/server/Slim/Control/Commands.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Commands.pm?rev=12486&r1=12485&r2=12486&view=diff
==============================================================================
--- trunk/server/Slim/Control/Commands.pm (original)
+++ trunk/server/Slim/Control/Commands.pm Sat Aug  4 10:26:35 2007
@@ -1425,42 +1425,33 @@
 
 	} else {
 
-		my $find  = {};
-		my @joins = ();
-
+		# rather than re-invent the wheel, use _playlistXtracksCommand_parseSearchTerms
+		
+		my $what = {};
+		
 		if (defined(my $genre_id = $request->getParam('genre_id'))) {
-
-			$find->{'genreTracks.genre'} = $genre_id;
-
-			push @joins, 'genreTracks';
+			$what->{'genre.id'} = $genre_id;
 		}
 
 		if (defined(my $artist_id = $request->getParam('artist_id'))) {
-
-			$find->{'contributorTracks.contributor'} = $artist_id;
-
-			push @joins, 'contributorTracks';
+			$what->{'contributor.id'} = $artist_id;
 		}
 
 		if (defined(my $album_id = $request->getParam('album_id'))) {
-
-			$find->{'me.album'} = $album_id;
+			$what->{'album.id'} = $album_id;
 		}
 
 		if (defined(my $year = $request->getParam('year'))) {
 
-			$find->{'me.year'} = $year;
+			$what->{'year.id'} = $year;
 		}
 		# Fred: form year_id DEPRECATED in 7.0
 		if (defined(my $year_id = $request->getParam('year_id'))) {
 
-			$find->{'me.year'} = $year_id;
-		}
-
-		@tracks = Slim::Schema->search('Track', $find, {
-			'order_by' => 'me.disc, me.tracknum, me.titlesort',
-			'join'     => \@joins,
-		})->distinct->all;
+			$what->{'year.id'} = $year_id;
+		}
+		
+		@tracks = _playlistXtracksCommand_parseSearchTerms($client, $what);
 	}
 
 	# don't call Xtracks if we got no songs



More information about the checkins mailing list