[Slim-Checkins] r9390 - in /trunk/server: Changelog6.html Slim/Formats.pm

dsully at svn.slimdevices.com dsully at svn.slimdevices.com
Sun Sep 3 15:34:33 PDT 2006


Author: dsully
Date: Sun Sep  3 15:34:29 2006
New Revision: 9390

URL: http://svn.slimdevices.com?rev=9390&view=rev
Log:
Bug: 3998
Description: Strip UTF-16 (or whatever) BOMs from the front of the nth genre in a multi-genre list.

Modified:
    trunk/server/Changelog6.html
    trunk/server/Slim/Formats.pm

Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=9390&r1=9389&r2=9390&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Sun Sep  3 15:34:29 2006
@@ -545,6 +545,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3980">#3980</a> - Initial WMA stream request sometimes gets truncated</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3981">#3981</a> - Firmware won't play alternate WMA streams</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3988">#3988</a> - bumpUp/Down to scroll bottom of screen only</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3998">#3998</a> - Multiple genre tags cause duplicate genre entries</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4000">#4000</a> - slave (spdif) clock settings are incorrect</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4003">#4003</a> - DAC mode should be called &quot;Audio Source&quot;</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4007">#4007</a> - Crash on Windows XP with -d_sql and running as a service</li>

Modified: trunk/server/Slim/Formats.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Formats.pm?rev=9390&r1=9389&r2=9390&view=diff
==============================================================================
--- trunk/server/Slim/Formats.pm (original)
+++ trunk/server/Slim/Formats.pm Sun Sep  3 15:34:29 2006
@@ -243,12 +243,26 @@
 
 	# Bug: 2381 - FooBar2k seems to add UTF8 boms to their values.
 	# Bug: 3769 - Strip trailing nulls
+	# Bug: 3998 - Strip UTF-16 BOMs from multiple genres (or other values).
 	while (my ($tag, $value) = each %{$tags}) {
 
 		if (defined $tags->{$tag}) {
 
-			$tags->{$tag} =~ s/$Slim::Utils::Unicode::bomRE//;
-			$tags->{$tag} =~ s/\000$//;
+			use bytes;
+
+			if (ref($tags->{$tag}) eq 'ARRAY') {
+
+				for (my $i = 0; $i < scalar @{$tags->{$tag}}; $i++) {
+
+					$tags->{$tag}->[$i] =~ s/$Slim::Utils::Unicode::bomRE//;
+					$tags->{$tag}->[$i] =~ s/\000$//;
+				}
+
+			} else {
+
+				$tags->{$tag} =~ s/$Slim::Utils::Unicode::bomRE//;
+				$tags->{$tag} =~ s/\000$//;
+			}
 		}
 		
 		$::d_info && $_dump_tags && $value && msg(". $tag : $value\n");



More information about the checkins mailing list