[Slim-Checkins] r10547 - in /branches/6.5/server: Changelog6.html Plugins/MusicMagic/Importer.pm

dsully at svn.slimdevices.com dsully at svn.slimdevices.com
Wed Nov 1 13:12:27 PST 2006


Author: dsully
Date: Wed Nov  1 13:12:25 2006
New Revision: 10547

URL: http://svn.slimdevices.com?rev=10547&view=rev
Log:
Bug: 4422
Description: Merge from trunk -r 10545:10546

Modified:
    branches/6.5/server/Changelog6.html
    branches/6.5/server/Plugins/MusicMagic/Importer.pm

Modified: branches/6.5/server/Changelog6.html
URL: http://svn.slimdevices.com/branches/6.5/server/Changelog6.html?rev=10547&r1=10546&r2=10547&view=diff
==============================================================================
--- branches/6.5/server/Changelog6.html (original)
+++ branches/6.5/server/Changelog6.html Wed Nov  1 13:12:25 2006
@@ -106,6 +106,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4389">#4389</a> - Following genre link on the Nokia770 skin Now Playing page crashes SlimServer</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4393">#4393</a> - Dark Skin displays albums in Gallery view in a single column</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4413">#4413</a> - registerParser api not working - breaks some AlienBBC streams</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4422">#4422</a> - MusicIP playlist containing files with accented characters generates duplicates in Slimserver</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4430">#4430</a> - Snow.pm loading Text Display on all player types</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4431">#4431</a> - Scanner fills up FileCache, causing disk issues and slows scanning speed.</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4432">#4432</a> - Purge of FileCache stalls slimserver for large collections</li>

Modified: branches/6.5/server/Plugins/MusicMagic/Importer.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Plugins/MusicMagic/Importer.pm?rev=10547&r1=10546&r2=10547&view=diff
==============================================================================
--- branches/6.5/server/Plugins/MusicMagic/Importer.pm (original)
+++ branches/6.5/server/Plugins/MusicMagic/Importer.pm Wed Nov  1 13:12:25 2006
@@ -359,6 +359,18 @@
 		my $playlist = get("http://$MMSHost:$MMSport/api/getPlaylist?index=$i") || next;
 		my @songs    = split(/\n/, $playlist);
 
+		# UTF8
+		if ($OS eq 'win') {
+
+			my $count = scalar @songs;
+
+			for (my $j = 0; $j < $count; $j++) {
+
+				my $enc = Slim::Utils::Unicode::encodingFromString($songs[$j]);
+				$songs[$j] = Slim::Utils::Unicode::utf8decode_guess($songs[$j], $enc);
+			}
+		}
+
 		$::d_musicmagic && msgf("MusicMagic: got playlist %s with %d items\n", $playlists[$i], scalar @songs);
 
 		$class->_updatePlaylist($playlists[$i], \@songs);
@@ -378,11 +390,23 @@
 	
 	my @songs = split(/\n/, get("http://$MMSHost:$MMSport/api/duplicates"));
 
+	# UTF8
+	if ($OS eq 'win') {
+
+		my $count = scalar @songs;
+
+		for (my $j = 0; $j < $count; $j++) {
+
+			my $enc = Slim::Utils::Unicode::encodingFromString($songs[$j]);
+			$songs[$j] = Slim::Utils::Unicode::utf8decode_guess($songs[$j], $enc);
+		}
+	}
+
 	$class->_updatePlaylist('Duplicates', \@songs);
 
 	$::d_musicmagic && msgf("MusicMagic: finished export (%d records)\n", scalar @songs);
 }
-	
+
 sub _updatePlaylist {
 	my ($class, $name, $songs) = @_;
 
@@ -399,12 +423,24 @@
 		$name,
 		Slim::Utils::Prefs::get('MusicMagicplaylistsuffix'),
 	);
-	
-	$attributes{'LIST'}  = [ map { Slim::Utils::Misc::fileURLFromPath(
-
-		Plugins::MusicMagic::Common::convertPath($_)
-
-	) } @{$songs} ];
+
+	$attributes{'LIST'}  = [];
+
+	for my $song (@$songs) {
+
+		if ($OS eq 'win') {
+
+			$song = Slim::Utils::Unicode::utf8decode_guess(
+				$song, Slim::Utils::Unicode::encodingFromString($song),
+			);
+		}
+
+		$song = Slim::Utils::Misc::fileURLFromPath(
+			Plugins::MusicMagic::Common::convertPath($song)
+		);
+
+		push @{$attributes{'LIST'}}, $song;
+	}
 
 	$attributes{'CT'}                 = 'mmp';
 	$attributes{'TAG'}                = 1;



More information about the checkins mailing list