mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Amazon metadata download: Recognize common patterns of embedding the series name after the title and remove it automatically
This commit is contained in:
parent
f915daed36
commit
150d6762f7
@ -881,6 +881,10 @@ class Amazon(Source):
|
|||||||
mi.isbn = check_isbn(mi.isbn)
|
mi.isbn = check_isbn(mi.isbn)
|
||||||
if mi.series and docase:
|
if mi.series and docase:
|
||||||
mi.series = fixcase(mi.series)
|
mi.series = fixcase(mi.series)
|
||||||
|
if mi.title and mi.series:
|
||||||
|
for pat in (r':\s*Book\s+\d+\s+of\s+%s$', r'\(%s\)$'):
|
||||||
|
pat = pat % re.escape(mi.series)
|
||||||
|
mi.title = re.sub(pat, '', mi.title, flags=re.I)
|
||||||
|
|
||||||
def get_website_domain(self, domain):
|
def get_website_domain(self, domain):
|
||||||
udomain = domain
|
udomain = domain
|
||||||
|
Loading…
x
Reference in New Issue
Block a user