Index: server/Slim/Player/ProtocolHandlers.pm =================================================================== --- server/Slim/Player/ProtocolHandlers.pm (revision 30726) +++ server/Slim/Player/ProtocolHandlers.pm (working copy) @@ -10,10 +10,12 @@ use strict; use Scalar::Util qw(blessed); +use File::Spec; use Slim::Utils::Log; use Slim::Utils::Misc; use Slim::Music::Info; +use Slim::Utils::Prefs; # the protocolHandlers hash contains the modules that handle specific URLs, # indexed by the URL protocol. built-in protocols are exist in the hash, but @@ -68,8 +70,29 @@ my ($class, $protocol, $classToRegister) = @_; $protocolHandlers{$protocol} = $classToRegister; + + # Bug 16188 -- the main SBS process should write a comma-delimited + # list of protocols to "handlers.txt" in the cache dir + # so the scanner knows that those are legitimate URL protocols + &_recordHandlers(); } +sub _recordHandlers { + my %handlersToRecord = %protocolHandlers; + delete $handlersToRecord{file}; # not file + delete $handlersToRecord{http}; # not http + delete $handlersToRecord{db}; # not db + delete $handlersToRecord{playlist}; # not playlist + my $handlerFile = File::Spec->catdir( preferences('server')->get('cachedir'), 'handlers.txt' ); + if (open(HFILE,">",$handlerFile)) { + print HFILE join(',',keys %handlersToRecord); + close HFILE; + } else { + logWarning("Couldn't create list of handlers in $handlerFile"); + } + 1; +} + sub registerIconHandler { my ($class, $regex, $ref) = @_; Index: server/scanner.pl =================================================================== --- server/scanner.pl (revision 30726) +++ server/scanner.pl (working copy) @@ -362,20 +362,20 @@ main::INFOLOG && $log->info("Squeezebox Server Info init..."); Slim::Music::Info::init(); + + # Bug 16188 -- the main SBS process should write a comma-delimited + # list of protocols to "handlers.txt" in the cache dir + # so the scanner knows that those are legitimate URL protocols + my $handlerFile = catdir( $prefs->get('cachedir'), 'handlers.txt' ); + my @handlers; + if ( open(HFILE,"<",$handlerFile) ) { + my $all = ; + @handlers = split(/,/,$all); + close HFILE; + } else { + $log->error("handler list $handlerFile not found!"); + } - # Bug 6721 - # The ProtocolHandlers class won't have all our handlers registered, - # and this can cause problems scanning playlists that contain URLs - # that use a protocol handler, i.e. rhapd:// - my @handlers = qw( - live365 - loop - pandora - rhapd - slacker - source - ); - for my $handler ( @handlers ) { Slim::Player::ProtocolHandlers->registerHandler( $handler => 1 ); }