Skip to content

Commit

Permalink
Google metadata download: When excluding results from a web search be…
Browse files Browse the repository at this point in the history
…cause they don't match the specified title/author ignore diacritic, accents, etc.
  • Loading branch information
kovidgoyal committed Aug 17, 2022
1 parent 765db1f commit 742fc54
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/calibre/ebooks/metadata/sources/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def get_extra_details():
class GoogleBooks(Source):

name = 'Google'
version = (1, 1, 0)
version = (1, 1, 1)
minimum_calibre_version = (2, 80, 0)
description = _('Downloads metadata and covers from Google Books')

Expand Down Expand Up @@ -397,6 +397,7 @@ def identify_via_web_search( # {{{
identifiers={},
timeout=30
):
from calibre.utils.filenames import ascii_text
isbn = check_isbn(identifiers.get('isbn', None))
q = []
strip_punc_pat = regex.compile(r'[\p{C}|\p{M}|\p{P}|\p{S}|\p{Z}]+', regex.UNICODE)
Expand All @@ -411,7 +412,7 @@ def to_check_tokens(*tokens):
t = t.lower()
if t in ('and', 'not', 'the'):
continue
yield strip_punc_pat.sub('', t)
yield ascii_text(strip_punc_pat.sub('', t))

if has_google_id:
google_ids.append(identifiers['google'])
Expand Down

0 comments on commit 742fc54

Please sign in to comment.