mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix langauge not being detected on amazon.de
This commit is contained in:
parent
0f56a27b97
commit
425152cda2
@ -885,7 +885,7 @@ class Worker(Thread): # Get details {{{
|
|||||||
|
|
||||||
def parse_detail_cells(self, mi, c1, c2):
|
def parse_detail_cells(self, mi, c1, c2):
|
||||||
name = self.totext(c1, only_printable=True).strip().strip(':').strip()
|
name = self.totext(c1, only_printable=True).strip().strip(':').strip()
|
||||||
val = self.totext(c2)
|
val = self.totext(c2).strip()
|
||||||
if not val:
|
if not val:
|
||||||
return
|
return
|
||||||
if name in self.language_names:
|
if name in self.language_names:
|
||||||
@ -968,7 +968,7 @@ class Worker(Thread): # Get details {{{
|
|||||||
class Amazon(Source):
|
class Amazon(Source):
|
||||||
|
|
||||||
name = 'Amazon.com'
|
name = 'Amazon.com'
|
||||||
version = (1, 2, 21)
|
version = (1, 2, 22)
|
||||||
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')
|
||||||
|
|
||||||
@ -1660,7 +1660,7 @@ def manual_tests(domain, **kw): # {{{
|
|||||||
{'title': 'Flüsternde Wälder',
|
{'title': 'Flüsternde Wälder',
|
||||||
'authors': ['Nicola Förg']},
|
'authors': ['Nicola Förg']},
|
||||||
[title_test('Flüsternde Wälder'),
|
[title_test('Flüsternde Wälder'),
|
||||||
authors_test(['Nicola Förg'])
|
authors_test(['Nicola Förg'], subset=True)
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ def title_test(title, exact=False):
|
|||||||
return test
|
return test
|
||||||
|
|
||||||
|
|
||||||
def authors_test(authors):
|
def authors_test(authors, subset=False):
|
||||||
authors = {x.lower() for x in authors}
|
authors = {x.lower() for x in authors}
|
||||||
|
|
||||||
def test(mi):
|
def test(mi):
|
||||||
@ -62,6 +62,8 @@ def authors_test(authors):
|
|||||||
|
|
||||||
au = {revert_to_fn_ln(x) for x in au}
|
au = {revert_to_fn_ln(x) for x in au}
|
||||||
|
|
||||||
|
if subset and authors.issubset(au):
|
||||||
|
return True
|
||||||
if au == authors:
|
if au == authors:
|
||||||
return True
|
return True
|
||||||
prints('Author test failed. Expected: \'%s\' found \'%s\''%(authors, au))
|
prints('Author test failed. Expected: \'%s\' found \'%s\''%(authors, au))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user