better author names

This commit is contained in:
j 2016-02-03 14:45:09 +05:30
parent 404842f849
commit b8fc91142a
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@ from io import BytesIO
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
@ -129,6 +129,8 @@ def info(epub):
data['isbn'] = value
elif key == 'author':
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:
data[key] = value
toc = [f for f in files if 'toc.ncx' in f]