[Slim-Checkins] r33949 - /7.7/trunk/server/Slim/Plugin/RadioTime/Metadata.pm

[email protected] Wed, 25 Apr 2012 07:42:25 -0000
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: mherger
Date: Wed Apr 25 00:42:25 2012
New Revision: 33949

URL: http://svn.slimdevices.com/slim?rev=33949&view=rev
Log:
Bug: n/a
Description: if TuneIn stream comes with ICY metadata, only look for artwork if it's not part of that tag (eg. Radio Paradise)

Modified:
    7.7/trunk/server/Slim/Plugin/RadioTime/Metadata.pm

Modified: 7.7/trunk/server/Slim/Plugin/RadioTime/Metadata.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Plugin/RadioTime/Metadata.pm?rev=33949&r1=33948&r2=33949&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Plugin/RadioTime/Metadata.pm (original)
+++ 7.7/trunk/server/Slim/Plugin/RadioTime/Metadata.pm Wed Apr 25 00:42:25 2012
@@ -108,7 +108,17 @@
 				$client->master->pluginData( metadata => undef );
 			}
 
-			fetchArtwork($client, $url, 'delayed');
+			# Check for an image URL in the metadata.
+			my $artworkUrl;
+			if ( $metadata =~ /StreamUrl=\'([^']+)\'/ ) {
+				$artworkUrl = $1;
+				if ( $artworkUrl !~ /\.(?:jpe?g|gif|png)$/i ) {
+					$artworkUrl = undef;
+				}
+			}
+
+			# lookup artwork unless it's been defined in the metadata (eg. Radio Paradise)
+			fetchArtwork($client, $url, 'delayed') unless $artworkUrl;
 			
 			# Let the default metadata handler process the Icy metadata
 			$client->master->pluginData( hasIcy => $url );