summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piper <nicholas@users.sourceforge.net>2006-04-07 19:07:43 +0000
committerNicholas Piper <nicholas@users.sourceforge.net>2006-04-07 19:07:43 +0000
commit73de51534a04453087c0c1ce3c646e754d76cb97 (patch)
treeed422900d2e7adc45fe5cbfb4e40cb7c4bfac321
parente8690aa99409fadedec9a671406655538f8e3fde (diff)
downloadlibgpod-73de51534a04453087c0c1ce3c646e754d76cb97.tar.gz
libgpod-73de51534a04453087c0c1ce3c646e754d76cb97.tar.xz
libgpod-73de51534a04453087c0c1ce3c646e754d76cb97.zip
Remove double quotes from search term, and remove 12" too.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1232 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rwxr-xr-xbindings/python/examples/coverart_fetch.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bindings/python/examples/coverart_fetch.py b/bindings/python/examples/coverart_fetch.py
index 77fd54a..0e23c73 100755
--- a/bindings/python/examples/coverart_fetch.py
+++ b/bindings/python/examples/coverart_fetch.py
@@ -59,9 +59,12 @@ for track in gpod.sw_get_tracks(itdb):
if not images.has_key((track.album,track.artist)):
query = "%s + %s" % (track.artist, track.album)
# nasty hacks to get better hits. Is there a library out there
- # for this?
- query = query.replace("Disk 2","")
- query = query.replace("Disk 1","")
+ # for this? Note we take out double quotes too: Amazon place
+ # this string literally into their XML response, so can end up
+ # giving us back: <Arg value="search"term"
+ # name="KeywordSearch"> which is not well formed :-(
+ for term in ["Disk 1", "Disk 2", '12"', '12 "','"']:
+ query = query.replace(term,"")
print "Searching for %s: " % query,
try:
albums = amazon.searchByKeyword(query,