[Slim-Checkins] r33892 - in /7.7/trunk/server: Changelog7.html Slim/Control/Commands.pm Slim/Player/ProtocolHandlers.pm

[email protected] Mon, 12 Mar 2012 21:26:45 -0000
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: agrundman
Date: Mon Mar 12 14:26:45 2012
New Revision: 33892

URL: http://svn.slimdevices.com/slim?rev=33892&view=rev
Log:
Fixed bug 17422, fix utf8 chars in db favorites

Modified:
    7.7/trunk/server/Changelog7.html
    7.7/trunk/server/Slim/Control/Commands.pm
    7.7/trunk/server/Slim/Player/ProtocolHandlers.pm

Modified: 7.7/trunk/server/Changelog7.html
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Changelog7.html?rev=33892&r1=33891&r2=33892&view=diff
==============================================================================
--- 7.7/trunk/server/Changelog7.html (original)
+++ 7.7/trunk/server/Changelog7.html Mon Mar 12 14:26:45 2012
@@ -14,6 +14,7 @@
 
 	<li>Bug Fixes:</li>
 	<ul>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17422">#17422</a> - Artist, Album and Genre Favorites with non-latin characters don't work from Player UI</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17680">#17680</a> - General install issue of LMS on ReadyNAS Pro (ends up with an install error)</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17777">#17777</a> - New & changed scan does not scan playlists</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17807">#17807</a> - Windows installer is showing German messages if no localization is available</li>

Modified: 7.7/trunk/server/Slim/Control/Commands.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Control/Commands.pm?rev=33892&r1=33891&r2=33892&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Control/Commands.pm (original)
+++ 7.7/trunk/server/Slim/Control/Commands.pm Mon Mar 12 14:26:45 2012
@@ -3441,6 +3441,11 @@
 
 				if (!utf8::is_utf8($value) && !utf8::decode($value)) { $log->warn("The following value is not UTF-8 encoded: $value"); }
 
+				if (utf8::is_utf8($value)) {
+					utf8::decode($value);
+					utf8::encode($value);
+				}
+
 				$class = ucfirst($1);
 				$obj   = Slim::Schema->single( $class, { $key => $value } );
 				

Modified: 7.7/trunk/server/Slim/Player/ProtocolHandlers.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Player/ProtocolHandlers.pm?rev=33892&r1=33891&r2=33892&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Player/ProtocolHandlers.pm (original)
+++ 7.7/trunk/server/Slim/Player/ProtocolHandlers.pm Mon Mar 12 14:26:45 2012
@@ -142,7 +142,14 @@
 	}
 
 	elsif ($url =~ /^db:album\.(\w+)=(.+)/) {
-		my $album = Slim::Schema->search('Album', { $1 => Slim::Utils::Misc::unescape($2) })->first;
+		my $value = Slim::Utils::Misc::unescape($2);
+		
+		if (utf8::is_utf8($value)) {
+			utf8::decode($value);
+			utf8::encode($value);
+		}
+		
+		my $album = Slim::Schema->search('Album', { $1 => $value })->first;
 
 		if ($album && $album->artwork) {
 			return 'music/' . $album->artwork . '/cover.png';