Amazon metadata download: Fix title and author names being bolded in the downloaded comments when using bing to get amazon metadata. Fixes #1674088 [When downloading book metadata, words from title and author name are bolded in "Comments"](https://bugs.launchpad.net/calibre/+bug/1674088)

This commit is contained in:
Kovid Goyal 2017-03-19 18:01:17 +05:30
parent 8cb7229045
commit 89bdcfe893

View File

@ -533,6 +533,12 @@ class Worker(Thread): # Get details {{{
' @class="emptyClear" or @id="collapsePS" or' ' @class="emptyClear" or @id="collapsePS" or'
' @id="expandPS"]'): ' @id="expandPS"]'):
c.getparent().remove(c) c.getparent().remove(c)
for b in desc.xpath('descendant::b[@style]'):
# Bing highlights search results
s = b.get('style', '')
if 'color' in s:
b.tag = 'span'
del b.attrib['style']
for a in desc.xpath('descendant::a[@href]'): for a in desc.xpath('descendant::a[@href]'):
del a.attrib['href'] del a.attrib['href']
@ -821,7 +827,7 @@ class Worker(Thread): # Get details {{{
class Amazon(Source): class Amazon(Source):
name = 'Amazon.com' name = 'Amazon.com'
version = (1, 1, 0) version = (1, 2, 0)
minimum_calibre_version = (2, 82, 0) minimum_calibre_version = (2, 82, 0)
description = _('Downloads metadata and covers from Amazon') description = _('Downloads metadata and covers from Amazon')