That patch needed some more work, or clicking an item in the "Now
Playing" list would have returned invalid values. We must only use the
"streamingSong" when we're actually looking up information for the song
currently being played. If we click an item in the playlist that's not
the case. Therefore this first checks whether the currently streaming
song is a remote stream, and whether its URL is the same as the URL we
are supposed to return the menu for:


Code:
--------------------
    diff --git a/Slim/Web/Pages/Trackinfo.pm b/Slim/Web/Pages/Trackinfo.pm
  index dcb8ee185..cc1013a0c 100644
  --- a/Slim/Web/Pages/Trackinfo.pm
  +++ b/Slim/Web/Pages/Trackinfo.pm
  @@ -25,13 +25,23 @@ sub trackinfo {
  my $params = shift;
  
  my $id    = $params->{sess} || $params->{item};
  +
  my $track = Slim::Schema->find( Track => $id );
  +       my $url   = $track ? $track->url : '';
  
  -       my $menu = Slim::Menu::TrackInfo->menu( $client, $track->url, $track 
) if $track;
  +       my $controller = $client->master->controller;
  +       my $song = $controller->streamingSong;
  +
  +       # let's try to get the real url for a remote stream
  +       if ($song && $song->isRemote && $song->streamUrl eq $url && 
$song->track && ($song->track->url ne $url)) {
  +               $url = $song->track->url
  +       }
  +
  +       my $menu = Slim::Menu::TrackInfo->menu( $client, $url, $track ) if 
$track;
  
  # some additional parameters for the nice favorites button at the top
  -       $params->{isFavorite} = defined 
Slim::Utils::Favorites->new($client)->findUrl($track->url);
  -       $params->{itemUrl}    = $track->url;
  +       $params->{isFavorite} = defined 
Slim::Utils::Favorites->new($client)->findUrl($url);
  +       $params->{itemUrl}    = $url;
  
  # Pass-through track ID as sess param
  $params->{sess} = $id;
  
--------------------



Michael

http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo
------------------------------------------------------------------------
mherger's Profile: http://forums.slimdevices.com/member.php?userid=50
View this thread: http://forums.slimdevices.com/showthread.php?t=110714

_______________________________________________
Squeezecenter mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/squeezecenter

Reply via email to