[Slim-Checkins] r11374 - in /trunk/server: Changelog7.html Slim/Schema.pm Slim/Schema/Track.pm

kdf at svn.slimdevices.com kdf at svn.slimdevices.com
Fri Feb 9 18:50:22 PST 2007


Author: kdf
Date: Fri Feb  9 18:50:22 2007
New Revision: 11374

URL: http://svn.slimdevices.com?rev=11374&view=rev
Log:
Bug: 4513
Description: drop iTunes comments from the comment attributes


Modified:
    trunk/server/Changelog7.html
    trunk/server/Slim/Schema.pm
    trunk/server/Slim/Schema/Track.pm

Modified: trunk/server/Changelog7.html
URL: http://svn.slimdevices.com/trunk/server/Changelog7.html?rev=11374&r1=11373&r2=11374&view=diff
==============================================================================
--- trunk/server/Changelog7.html (original)
+++ trunk/server/Changelog7.html Fri Feb  9 18:50:22 2007
@@ -71,6 +71,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4409">#4409</a> - All fonts lost</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4437">#4437</a> - Navigating unsorted lists with the number keys doesn't work
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4507">#4507</a> - Touch skin needs to work in IE</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4513">#4513</a> - SlimServer should ignore the iTunes COMMENTs: ITUNPGAP & ITUNSMPB</li>
 </li>
 	<ul>
 		<li></li>

Modified: trunk/server/Slim/Schema.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Schema.pm?rev=11374&r1=11373&r2=11374&view=diff
==============================================================================
--- trunk/server/Slim/Schema.pm (original)
+++ trunk/server/Slim/Schema.pm Fri Feb  9 18:50:22 2007
@@ -1254,7 +1254,7 @@
 		$progress->update($albumObj->name);
 	}
 
-	$progress->final($count);
+	$progress->final($count) if $count;
 
 	Slim::Music::Import->endImporter('mergeVariousAlbums');
 }
@@ -1634,21 +1634,37 @@
 
 	# We can take an array too - from vorbis comments, so be sure to handle that.
 	my $comments = [];
+	my $rawcomments = [];
 
 	if ($attributes->{'COMMENT'} && !ref($attributes->{'COMMENT'})) {
 
-		$comments = [ $attributes->{'COMMENT'} ];
+		$rawcomments = [ $attributes->{'COMMENT'} ];
 
 	} elsif (ref($attributes->{'COMMENT'}) eq 'ARRAY') {
 
-		$comments = $attributes->{'COMMENT'};
+		$rawcomments = $attributes->{'COMMENT'};
 	}
 
 	# Bug: 2605 - Get URL out of the attributes - some programs, and
 	# services such as www.allofmp3.com add it.
 	if ($attributes->{'URL'}) {
 
-		push @$comments, delete $attributes->{'URL'};
+		push @$rawcomments, delete $attributes->{'URL'};
+	}
+
+	# Look for tags we don't want to expose in comments, and splice them out.
+	for my $c(@$rawcomments) {
+
+		#ignore SoundJam and iTunes CDDB comments, iTunSMPB, iTunPGAP
+		if ($c =~ /SoundJam_CDDB_/ ||
+		    $c =~ /iTunes_CDDB_/ ||
+		    $c =~ /^iTun[A-Z]{4}/ ||
+		    $c =~ /^\s*[0-9A-Fa-f]{8}(\+|\s)/ ||
+		    $c =~ /^\s*[0-9A-Fa-f]{2}\+[0-9A-Fa-f]{32}/) {
+
+			next;
+		}
+		push @$comments, $c;
 	}
 
 	$attributes->{'COMMENT'} = $comments;

Modified: trunk/server/Slim/Schema/Track.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Schema/Track.pm?rev=11374&r1=11373&r2=11374&view=diff
==============================================================================
--- trunk/server/Slim/Schema/Track.pm (original)
+++ trunk/server/Slim/Schema/Track.pm Fri Feb  9 18:50:22 2007
@@ -167,14 +167,6 @@
 
 		next unless $c;
 
-		# ignore SoundJam and iTunes CDDB comments
-		if ($c =~ /SoundJam_CDDB_/ ||
-		    $c =~ /iTunes_CDDB_/ ||
-		    $c =~ /^\s*[0-9A-Fa-f]{8}(\+|\s)/ ||
-		    $c =~ /^\s*[0-9A-Fa-f]{2}\+[0-9A-Fa-f]{32}/) {
-			next;
-		} 
-
 		# put a slash between multiple comments.
 		$comment .= ' / ' if $comment;
 		$c =~ s/^eng(.*)/$1/;



More information about the checkins mailing list