EPUB 3: Fix setting metadata in EPUB 3 files with a title not working

This commit is contained in:
Kovid Goyal 2019-08-10 22:15:36 +05:30
parent b808ee0078
commit 91a0659a9c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -382,7 +382,7 @@ def set_title(root, prefixes, refines, title, title_sort=None):
main_title = find_main_title(root, refines, remove_blanks=True)
if main_title is None:
m = XPath('./opf:metadata')(root)[0]
main_title = m.makeelement('dc:title')
main_title = m.makeelement(DC('title'))
m.insert(0, main_title)
main_title.text = title or None
ts = [refdef('file-as', title_sort)] if title_sort else ()