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

andy at svn.slimdevices.com andy at svn.slimdevices.com
Wed Aug 29 14:50:42 PDT 2007


Author: andy
Date: Wed Aug 29 14:50:42 2007
New Revision: 12790

URL: http://svn.slimdevices.com?rev=12790&view=rev
Log:
Update Jive Now Playing text with plugin metadata

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=12790&r1=12789&r2=12790&view=diff
==============================================================================
--- trunk/server/Slim/Control/Queries.pm (original)
+++ trunk/server/Slim/Control/Queries.pm Wed Aug 29 14:50:42 2007
@@ -2657,7 +2657,7 @@
 		my $quantity = $request->getParam('_quantity');
 	
 		$tags = 'gald' if !defined $tags;
-		my $loop = $menuMode?'item_loop':'playlist_loop';
+		my $loop = $menuMode ? 'item_loop' : 'playlist_loop';
 
 		# we can return playlist data.
 		# which mode are we in?
@@ -2740,12 +2740,28 @@
 						}
 						$text = $text . "\n" . (defined($artist)?$artist:"");
 						
-						$request->addResultLoop($loop, $count, 'text', $text);
-						
 						if (defined($iconId)) {
 							$iconId += 0;
 							$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};
+							}
+						
+							if ( $current_meta->{cover} ) {
+								$request->addResultLoop( $loop, $count, 'icon', $current_meta->{cover} );
+							}
+						}
+						
+						$request->addResultLoop($loop, $count, 'text', $text);
 					}
 					else {
 						_addSong(	$request, $loop, $count, 



More information about the checkins mailing list