Re: scanUrl not being called

Paul Webster <Paul.Webster.a1unvc-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]>
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
Still having problems after removing explodePlaylist and having a
getNextTrack
My code that takes the given protocol:// string to find the real stream
URL is working - and returning the right value.

getNextTrack is called by LMS soon after scanUrl returns.
The code looks (to me) to be essentially the same as in
Slim::Plugin::RemoteLibrary::ProtocolHandler


Code:
--------------------
    
  sub getNextTrack {
  	my ( $class, $song, $successCb, $errorCb ) = @_;
  	my $masterUrl = $song->track()->url;
  	main::INFOLOG && $log->is_info && $log->info("getNextTrack " . $masterUrl);
  
  	if ( $masterUrl =~ /^$thisProtocol:/ ) {
  
  		my ($scheme, $auth, $path, $query, $frag) = uri_split($masterUrl);
  		
  		my $streamUrl;
  		
  		if ( $auth ){
  			$streamUrl = Plugins::myplugin::Plugin::_matchId( $auth );
  		}
  
  		main::DEBUGLOG && $log->is_debug && $log->debug("Setting Live Stream $streamUrl");
  		
  		$song->streamUrl($streamUrl);
  		#$song->track->bitrate(128_000);
  
  		$successCb->();
  	}
  
  }
  
--------------------


Edited log

Code:
--------------------
    
  [21-05-18 15:37:49.6711] Plugins::myplugin::ProtocolHandler::scanUrl (70) scanurl myplugin://test
  [21-05-18 15:37:49.6719] Plugins::myplugin::Plugin::_matchId (5586) _matchId: test exists
  [21-05-18 15:37:49.6725] Plugins::myplugin::ProtocolHandler::scanUrl (83) scanurl myplugin://test actual stream https://somewhere.com/stream.aac
  [21-05-18 15:37:52.4808] Plugins::myplugin::ProtocolHandler::getNextTrack (97) getNextTrack myplugin://test
  [21-05-18 15:37:52.4821] Plugins::myplugin::Plugin::_matchId (5586) _matchId: test exists
  [21-05-18 15:37:52.4832] Plugins::myplugin::ProtocolHandler::getNextTrack (109) Setting Live Stream https://somewhere.com/stream.aac
  [21-05-18 15:37:52.4874] Slim::Player::Song::open (415) Error: Couldn't create command line for unk playback for [myplugin://test]
  
--------------------


If I play the same final stream url in LMS then it works fine.
It looks to me like the line

Code:
--------------------
    $song->streamUrl($streamUrl);
--------------------

did not change the song data so LMS tried to create a command line to
handle myplugin: which failed.

Sorry for the trouble.
I don't want to share the exact stream URL in public for reasons that I
am happy to explain via PM or email.
I can share the current code if an expert is willing to take a look
offline.



Paul Webster
http://dabdig.blogspot.com
author of \"now playing\" plugins covering radio france (fip etc),
planetradio (bauer - kiss, absolute, scala, jazzfm etc), kcrw, supla
finland, abc australia, cbc/radio-canada and rte ireland
------------------------------------------------------------------------
Paul Webster's Profile: http://forums.slimdevices.com/member.php?userid=105
View this thread: http://forums.slimdevices.com/showthread.php?t=114599
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.