[Slim-Checkins] r10094 - in /trunk/server: Plugins/RandomPlay/Plugin.pm Slim/Player/Source.pm

andy at svn.slimdevices.com andy at svn.slimdevices.com
Fri Sep 29 09:37:20 PDT 2006


Author: andy
Date: Fri Sep 29 09:37:18 2006
New Revision: 10094

URL: http://svn.slimdevices.com?rev=10094&view=rev
Log:
Bug 3696, restart Random Mix if the last track fails to play

Modified:
    trunk/server/Plugins/RandomPlay/Plugin.pm
    trunk/server/Slim/Player/Source.pm

Modified: trunk/server/Plugins/RandomPlay/Plugin.pm
URL: http://svn.slimdevices.com/trunk/server/Plugins/RandomPlay/Plugin.pm?rev=10094&r1=10093&r2=10094&view=diff
==============================================================================
--- trunk/server/Plugins/RandomPlay/Plugin.pm (original)
+++ trunk/server/Plugins/RandomPlay/Plugin.pm Fri Sep 29 09:37:18 2006
@@ -591,6 +591,13 @@
 		msgf("RandomPlay: received command %s\n", $request->getRequestString);
 		msgf("RandomPlay: while in mode: %s, from %s\n", $mixInfo{$client->masterOrSelf->id}->{'type'}, $client->name);
 	}
+	
+	# Bug 3696, If the last track in the playlist failed, restart play
+	if ( $request->isCommand([['playlist'], ['cant_open']]) && $client->playmode !~ /play/ ) {
+		$::d_plugins && msg("RandomPlay: Last track failed, restarting\n");
+		playRandom($client, $mixInfo{$client->masterOrSelf->id}->{'type'});
+		return;
+	}		
 
 	my $songIndex = Slim::Player::Source::streamingSongIndex($client);
 
@@ -648,7 +655,7 @@
 
 	# set up our subscription
 	Slim::Control::Request::subscribe(\&commandCallback, 
-		[['playlist'], ['newsong', 'delete', keys %stopcommands]]);
+		[['playlist'], ['newsong', 'delete', 'cant_open', keys %stopcommands]]);
 
 	# Regenerate the genre map after a rescan.
 	Slim::Control::Request::subscribe(\&generateGenreNameMap, [['rescan'], ['done']]);

Modified: trunk/server/Slim/Player/Source.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Source.pm?rev=10094&r1=10093&r2=10094&view=diff
==============================================================================
--- trunk/server/Slim/Player/Source.pm (original)
+++ trunk/server/Slim/Player/Source.pm Fri Sep 29 09:37:18 2006
@@ -1204,6 +1204,9 @@
 	my $line1 = shift || $client->string('PROBLEM_OPENING');
 	my $line2 = Slim::Music::Info::standardTitle($client, Slim::Player::Playlist::song($client, streamingSongIndex($client)));
 	
+	my $url = Slim::Player::Playlist::url($client, streamingSongIndex($client));
+	Slim::Control::Request::notifyFromArray($client, ['playlist', 'cant_open', $url, $line1]);
+	
 	$client->showBriefly($line1, $line2, 5, 1, 1);
 }
 



More information about the checkins mailing list