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

dsully at svn.slimdevices.com dsully at svn.slimdevices.com
Mon Oct 2 13:16:02 PDT 2006


Author: dsully
Date: Mon Oct  2 13:16:01 2006
New Revision: 10132

URL: http://svn.slimdevices.com?rev=10132&view=rev
Log:
Bug: 2373
Description: Allow playlistcontrol playlist_name command to work.

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=10132&r1=10131&r2=10132&view=diff
==============================================================================
--- trunk/server/Slim/Control/Commands.pm (original)
+++ trunk/server/Slim/Control/Commands.pm Mon Oct  2 13:16:01 2006
@@ -1218,7 +1218,25 @@
 	# find the songs
 	my @tracks = ();
 
-	if (defined(my $playlist_id = $request->getParam('playlist_id'))) {
+	# Bug: 2373 - allow the user to specify a playlist name
+	my $playlist_id = 0;
+
+	if (defined(my $playlist_name = $request->getParam('playlist_name'))) {
+
+		my $playlistObj = Slim::Schema->single('Playlist', { 'title' => $playlist_name });
+
+		if (blessed($playlistObj)) {
+
+			$playlist_id = $playlistObj->id;
+		}
+	}
+
+	if (!$playlist_id && $request->getParam('playlist_id')) {
+
+		$playlist_id = $request->getParam('playlist_id');
+	}
+
+	if ($playlist_id) {
 
 		# Special case...
 		my $playlist = Slim::Schema->find('Playlist', $playlist_id);



More information about the checkins mailing list