Using MusicIP Moods showed unsanitized Mood names if the mood names
contained »foreign« characters (non-ASCII). Example from a log:


Code:
--------------------
    
  Slim::Plugin::MusicMagic::Plugin::grabMoods (468) Found moods:
  Slim::Plugin::MusicMagic::Plugin::grabMoods (472)     Moonbase - Musik für 
ruhige Stunden
  
--------------------


These mood names were forgotten to be converted in MusicIP
plugin’s -Plugin.pm-, they -should- look like these:


Code:
--------------------
    
  Slim::Plugin::MusicMagic::Plugin::grabMoods (468) Found moods:
  Slim::Plugin::MusicMagic::Plugin::grabMoods (472)     Moonbase - Musik für 
ruhige Stunden
  
--------------------


This bug now exists for quite a while, so I went and fixed it, for the
time being and for the Windows official 7.3 release (24282).

File to be changed on a typical Windows installation:
C:\PROGRAM FILES\SQUEEZECENTER\SERVER\SLIM\PLUGIN\MUSICMAGIC\PLUGIN.PM
Here’s the -diff- against the 7.3-24282 version of -Plugin.pm-:

Code:
--------------------
    
  465a466,481
  >     if (scalar @moods) {
  >       # MIP returns mood names as UTF-8 even on windows, so we need to 
convert
  >       for my $mood (@moods) {
  > 
  >         if ($isWin) {
  > 
  >           $mood = Slim::Utils::Unicode::utf8decode_guess(
  >             $mood, Slim::Utils::Unicode::encodingFromString($mood),
  >           );
  >         }
  > 
  >         # need conversion to the current charset.
  >         $mood = Slim::Utils::Unicode::utf8encode_locale($mood);
  >       }
  >     }
  > 
  
--------------------


-I URGE THE DEVELOPERS TO PLEASE CHECK THE MODIFICATION AND SEE IF IT
WON’T BREAK LINUX OR MACOS INSTALLATIONS—THANK YOU! (OF
COURSE IT WOULD ALSO BE NICE TO INTEGRATE IT INTO THE NEXT VERSION
…)-
After applying this change, no rescans need to be done.

This works fine on -my- Windows/XP-SP2 installation of SC v7.3-24282
but of course I can’t take any responsibilities or warranty
whatsoever. So if you try this out, it’s entirely on your own
risk. Please make a backup of at least the old -Plugin.pm- file.


-- 
Moonbase

Moonbase: 'The Problem Solver' (http://www.kaufen-ist-toll.de/moonbase)
------------------------------------------------------------------------
Moonbase's Profile: http://forums.slimdevices.com/member.php?userid=21594
View this thread: http://forums.slimdevices.com/showthread.php?t=56376

_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/beta

Reply via email to