[Slim-Checkins] r12655 - in /trunk/server/Slim: Control/Commands.pm Player/Source.pm

andy at svn.slimdevices.com andy at svn.slimdevices.com
Tue Aug 21 18:48:52 PDT 2007


Author: andy
Date: Tue Aug 21 18:48:52 2007
New Revision: 12655

URL: http://svn.slimdevices.com?rev=12655&view=rev
Log:
Fix a bug in async onJump handling, must check canDoAction before we actually skip (merged from SN)

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

Modified: trunk/server/Slim/Control/Commands.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Commands.pm?rev=12655&r1=12654&r2=12655&view=diff
==============================================================================
--- trunk/server/Slim/Control/Commands.pm (original)
+++ trunk/server/Slim/Control/Commands.pm Tue Aug 21 18:48:52 2007
@@ -636,7 +636,6 @@
 		$request->setStatusDone();
 	};
 	
-	# Allow protocol handler to perform async handling before jumpto is called
 	if ( defined $index ) {
 		my $jumpIndex = $index;
 		
@@ -660,6 +659,19 @@
 		my $jumpURL   = Slim::Player::Playlist::url( $client, $jumpIndex );
 		my $handler   = Slim::Player::ProtocolHandlers->handlerForURL($jumpURL);
 		
+		# Allow Pandora and Slacker to disallow skip
+		if ( 
+			$client->playmode =~ /play/
+			&& $handler
+			&& $handler->can('canDoAction')
+			&& !$handler->canDoAction( $client, $jumpURL, 'stop' )
+		) {
+			$log->debug("Skip for $jumpURL disallowed by protocol handler");
+			$request->setStatusDone();
+			return;
+		}
+		
+		# Allow protocol handler to perform async handling before jumpto is called
 		if ( $handler && $handler->can('onJump') ) {
 			$handler->onJump( $client, $jumpURL, $jumpCallback );
 			return;

Modified: trunk/server/Slim/Player/Source.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Source.pm?rev=12655&r1=12654&r2=12655&view=diff
==============================================================================
--- trunk/server/Slim/Player/Source.pm (original)
+++ trunk/server/Slim/Player/Source.pm Tue Aug 21 18:48:52 2007
@@ -1099,15 +1099,6 @@
 		}
 	}
 	
-	# Allow Pandora to disallow skips completely
-	if ( $handler &&
-		$handler->can("canDoAction") &&
-		$client->playmode =~ /play/ && 
-		!$handler->canDoAction($client, $currentURL, 'stop')
-	) {
-		return;
-	}
-
 	playmode($client, 'stop');
 
 	if ($songcount != 1) {



More information about the checkins mailing list