Skip to content

Commit 7cac4ad

Browse files
committed
importEHdb: restrict blur_title to BMP
1 parent 40cdd03 commit 7cac4ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

comiclib/scanner/30-importEHdb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def blur_title(title: str):
2121
return title
2222
if settings.importEHdb_matchtitle == 'exact':
2323
return title
24-
return title.translate(str.maketrans({
24+
# also restrict to Basic Multilingual Plane
25+
return ''.join(map(lambda c:c if ord(c) <= 0xFFFF else '_', title)).translate(
26+
str.maketrans({
2527
' ': None,
2628
'_': None,
2729
'(': None,
@@ -47,7 +49,7 @@ def blur_title(title: str):
4749
}))
4850

4951
# Please update the version once the above function is updated.
50-
blur_title_version = 2
52+
blur_title_version = 3
5153
title2gid_table = 'gallery' if settings.importEHdb_matchtitle == 'exact' else f'comiclib_title2gid_v{blur_title_version}'
5254
title2gid_index = 'gallery_title' if settings.importEHdb_matchtitle == 'exact' else f'title_index_v{blur_title_version}'
5355
titlejpn2gid_table = f"comiclib_titlejpn2gid_v{0 if settings.importEHdb_matchtitle == 'exact' else blur_title_version}"

0 commit comments

Comments
 (0)