Author: duncan
Date: Thu Jan 18 19:44:16 2007
New Revision: 8995

Modified:
   branches/rel-1/freevo/freevo_config.py
   branches/rel-1/freevo/local_conf.py.example
   branches/rel-1/freevo/src/audio/plugins/coversearch.py

Log:
[ 1638259 ] coversearch does not support unicode search
Patch from Guillaume Proux applied


Modified: branches/rel-1/freevo/freevo_config.py
==============================================================================
--- branches/rel-1/freevo/freevo_config.py      (original)
+++ branches/rel-1/freevo/freevo_config.py      Thu Jan 18 19:44:16 2007
@@ -686,6 +686,12 @@
 plugin.activate('audio.detach', level=20)
 plugin.activate('audio.detachbar')
 
+# Amazon seems to request the covers in one locale and get the data
+# in another encoding
+#
+AMAZON_LOCALE = 'latin-1'
+AMAZON_QUERY_ENCODING = AMAZON_LOCALE
+
 # use mplayer for tv
 # to use tvtime, put the following two lines in your local_conf.py:
 # plugin.remove('tv.mplayer')

Modified: branches/rel-1/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1/freevo/local_conf.py.example (original)
+++ branches/rel-1/freevo/local_conf.py.example Thu Jan 18 19:44:16 2007
@@ -1508,3 +1508,11 @@
 #
 # display proc-stats, CPU and RAM usage
 # plugin.activate('idlebar.system.procstats',level=20)
+
+# Amazon coversearch seems to request the covers in one locale and get the data
+# in another encoding
+#
+# AMAZON_LOCALE = 'latin-1'
+# AMAZON_QUERY_ENCODING = AMAZON_LOCALE
+# plugin.activate('audio.coversearch')
+

Modified: branches/rel-1/freevo/src/audio/plugins/coversearch.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/coversearch.py      (original)
+++ branches/rel-1/freevo/src/audio/plugins/coversearch.py      Thu Jan 18 
19:44:16 2007
@@ -59,6 +59,11 @@
 
 from util import amazon
 
+try:
+    amazon.setLocale(config.AMAZON_LOCALE)
+except AttributeError:
+    pass
+query_encoding = config.AMAZON_QUERY_ENCODING
 
 class PluginInterface(plugin.ItemPlugin):
     """
@@ -185,7 +190,7 @@
         artist = self.item.getattr('artist')
 
         # Maybe the search string need encoding to config.LOCALE
-        search_string = '%s %s' % (artist.encode('latin-1'), 
album.encode('latin-1'))
+        search_string = '%s %s' % (artist.encode(query_encoding), 
album.encode(query_encoding))
         search_string = re.sub('[\(\[].*[\)\]]', '', search_string)
         if config.DEBUG > 1:
             print "search_string=%r" % search_string

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to