better author names
This commit is contained in:
parent
404842f849
commit
b8fc91142a
1 changed files with 3 additions and 1 deletions
|
@ -12,7 +12,7 @@ from io import BytesIO
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
from ox import strip_tags, decode_html
|
from ox import strip_tags, decode_html, normalize_name
|
||||||
|
|
||||||
from utils import find_isbns, get_language, to_isbn13
|
from utils import find_isbns, get_language, to_isbn13
|
||||||
|
|
||||||
|
@ -129,6 +129,8 @@ def info(epub):
|
||||||
data['isbn'] = value
|
data['isbn'] = value
|
||||||
elif key == 'author':
|
elif key == 'author':
|
||||||
data[key] = value.split(', ')
|
data[key] = value.split(', ')
|
||||||
|
if len(data[key]) == 2 and max(len(d.split(' ')) for d in data[key]) == 1:
|
||||||
|
data[key] = [normalize_name(', '.join(data[key]))]
|
||||||
else:
|
else:
|
||||||
data[key] = value
|
data[key] = value
|
||||||
toc = [f for f in files if 'toc.ncx' in f]
|
toc = [f for f in files if 'toc.ncx' in f]
|
||||||
|
|
Loading…
Reference in a new issue