From b8fc91142a27aaff48bc940c052c612f9b11ae3f Mon Sep 17 00:00:00 2001 From: j Date: Wed, 3 Feb 2016 14:45:09 +0530 Subject: [PATCH] better author names --- oml/media/epub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oml/media/epub.py b/oml/media/epub.py index fb6473f..960a11d 100644 --- a/oml/media/epub.py +++ b/oml/media/epub.py @@ -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]