1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Remove duplicate covers from Amazon search results. Fixes issue 2053. Thanks sfera.

This commit is contained in:
David Sansome 2011-07-06 15:55:14 +00:00
parent bad7c7a47d
commit bf655691be

View File

@ -77,6 +77,7 @@ class AmazonCoverProvider(clementine.CoverProvider):
LOGGER.exception(ex) LOGGER.exception(ex)
return parsed return parsed
used_urls = set()
# decode the result # decode the result
try: try:
items = [] items = []
@ -97,9 +98,10 @@ class AmazonCoverProvider(clementine.CoverProvider):
if current_url is None: if current_url is None:
current_url = item.find('MediumImage/URL') current_url = item.find('MediumImage/URL')
if current_url is None: if current_url is None or current_url.text in used_urls:
continue continue
used_urls.add(current_url.text)
current = clementine.CoverSearchResult() current = clementine.CoverSearchResult()
current.description = str(query) current.description = str(query)
current.image_url = str(current_url.text) current.image_url = str(current_url.text)