[Slim-Checkins] r12802 - /trunk/server/Slim/Control/Queries.pm

andy at svn.slimdevices.com andy at svn.slimdevices.com
Thu Aug 30 14:03:50 PDT 2007


Author: andy
Date: Thu Aug 30 14:03:50 2007
New Revision: 12802

URL: http://svn.slimdevices.com?rev=12802&view=rev
Log:
Rhapsody metadata was being set for all tracks in the playlist.  Now fixed to only update the currently playing item.  Still need to come up with a way to handle metadata for non-playing tracks

Modified:
    trunk/server/Slim/Control/Queries.pm

Modified: trunk/server/Slim/Control/Queries.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Queries.pm?rev=12802&r1=12801&r2=12802&view=diff
==============================================================================
--- trunk/server/Slim/Control/Queries.pm (original)
+++ trunk/server/Slim/Control/Queries.pm Thu Aug 30 14:03:50 2007
@@ -2717,8 +2717,10 @@
 				my $count = 0;
 				$start += 0;
 				$request->addResult('offset', $start) if $menuMode;
-
-				for ($idx = $start; $idx <= $end; $idx++){
+				
+				my $playlist_cur_index = Slim::Player::Source::playingSongIndex($client);
+
+				for ($idx = $start; $idx <= $end; $idx++) {
 					
 					my $track = Slim::Player::Playlist::song($client, $idx);
 
@@ -2745,19 +2747,21 @@
 							$request->addResultLoop($loop, $count, 'icon-id', $iconId);
 						}
 						
-						# Override with plugin metadata if available
-						if ( my $current_meta = $request->getResult('current_meta') ) {
-							$text = $current_meta->{title} . "\n";
-							if ( $current_meta->{album} ) {
-								$text .= $current_meta->{album};
-							}
-							$text .= "\n";
-							if ( $current_meta->{artist} ) {
-								$text .= $current_meta->{artist};
-							}
+						# Override with plugin metadata for the current track if available
+						if ( $idx == $playlist_cur_index ) {
+							if ( my $current_meta = $request->getResult('current_meta') ) {
+								$text = $current_meta->{title} . "\n";
+								if ( $current_meta->{album} ) {
+									$text .= $current_meta->{album};
+								}
+								$text .= "\n";
+								if ( $current_meta->{artist} ) {
+									$text .= $current_meta->{artist};
+								}
 						
-							if ( $current_meta->{cover} ) {
-								$request->addResultLoop( $loop, $count, 'icon', $current_meta->{cover} );
+								if ( $current_meta->{cover} ) {
+									$request->addResultLoop( $loop, $count, 'icon', $current_meta->{cover} );
+								}
 							}
 						}
 						



More information about the checkins mailing list