mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Metadata download: Fix metadata download not working for titles that contain a apostrophes in languages other than English. Fixes #1403677 [Search metadata fails](https://bugs.launchpad.net/calibre/+bug/1403677)
This commit is contained in:
parent
c33d682de7
commit
9106c49b49
@ -377,8 +377,6 @@ class Source(Plugin):
|
|||||||
(r'(\d+),(\d+)', r'\1\2'),
|
(r'(\d+),(\d+)', r'\1\2'),
|
||||||
# Remove hyphens only if they have whitespace before them
|
# Remove hyphens only if they have whitespace before them
|
||||||
(r'(\s-)', ' '),
|
(r'(\s-)', ' '),
|
||||||
# Remove single quotes not followed by 's'
|
|
||||||
(r"'(?!s)", ''),
|
|
||||||
# Replace other special chars with a space
|
# Replace other special chars with a space
|
||||||
(r'''[:,;!@$%^&*(){}.`~"\s\[\]/]''', ' '),
|
(r'''[:,;!@$%^&*(){}.`~"\s\[\]/]''', ' '),
|
||||||
]]
|
]]
|
||||||
@ -388,7 +386,7 @@ class Source(Plugin):
|
|||||||
|
|
||||||
tokens = title.split()
|
tokens = title.split()
|
||||||
for token in tokens:
|
for token in tokens:
|
||||||
token = token.strip()
|
token = token.strip().strip('"').strip("'")
|
||||||
if token and (not strip_joiners or token.lower() not in ('a',
|
if token and (not strip_joiners or token.lower() not in ('a',
|
||||||
'and', 'the', '&')):
|
'and', 'the', '&')):
|
||||||
yield token
|
yield token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user