[Slim-Checkins] r10095 - in /branches/6.5/server: Plugins/RandomPlay/Plugin.pm Slim/Player/Source.pm

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


Author: andy
Date: Fri Sep 29 09:38:07 2006
New Revision: 10095

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

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

Modified: branches/6.5/server/Plugins/RandomPlay/Plugin.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Plugins/RandomPlay/Plugin.pm?rev=10095&r1=10094&r2=10095&view=diff
==============================================================================
--- branches/6.5/server/Plugins/RandomPlay/Plugin.pm (original)
+++ branches/6.5/server/Plugins/RandomPlay/Plugin.pm Fri Sep 29 09:38:07 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: branches/6.5/server/Slim/Player/Source.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Player/Source.pm?rev=10095&r1=10094&r2=10095&view=diff
==============================================================================
--- branches/6.5/server/Slim/Player/Source.pm (original)
+++ branches/6.5/server/Slim/Player/Source.pm Fri Sep 29 09:38:07 2006
@@ -1218,6 +1218,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