From 73de51534a04453087c0c1ce3c646e754d76cb97 Mon Sep 17 00:00:00 2001 From: Nicholas Piper Date: Fri, 7 Apr 2006 19:07:43 +0000 Subject: 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 --- bindings/python/examples/coverart_fetch.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bindings/python') 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: 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, -- cgit