mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1971015 [[Bug] Amazon metadata downloader give empty title if title start with "["](https://bugs.launchpad.net/calibre/+bug/1971015)
This commit is contained in:
parent
72371f4f87
commit
3db4c98315
@ -522,9 +522,9 @@ class Worker(Thread): # Get details {{{
|
||||
def parse_title(self, root):
|
||||
|
||||
def sanitize_title(title):
|
||||
ans = re.sub(r'[(\[].*[)\]]', '', title).strip()
|
||||
if not ans:
|
||||
ans = title.rpartition('[')[0].strip()
|
||||
ans = title.strip()
|
||||
if not ans.startswith('['):
|
||||
ans = re.sub(r'[(\[].*[)\]]', '', title).strip()
|
||||
return ans
|
||||
|
||||
h1 = root.xpath('//h1[@id="title"]')
|
||||
@ -975,7 +975,7 @@ class Worker(Thread): # Get details {{{
|
||||
class Amazon(Source):
|
||||
|
||||
name = 'Amazon.com'
|
||||
version = (1, 2, 26)
|
||||
version = (1, 2, 27)
|
||||
minimum_calibre_version = (2, 82, 0)
|
||||
description = _('Downloads metadata and covers from Amazon')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user