From ae1ecf65425e3da0b9ee38301bd0f368d3254fbc Mon Sep 17 00:00:00 2001 From: Cervinko Cera Date: Sun, 7 Aug 2016 23:32:55 +0200 Subject: [PATCH] Fix for missing metadata in pdf files --- cps/book_formats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cps/book_formats.py b/cps/book_formats.py index f88faf52..6c4aa555 100644 --- a/cps/book_formats.py +++ b/cps/book_formats.py @@ -70,8 +70,9 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): doc_info = None if (doc_info is not None): - author = doc_info.author - title = doc_info.title + print doc_info + author = doc_info.author if doc_info.author is not None else "Unknown" + title = doc_info.title if doc_info.title is not None else original_file_name subject = doc_info.subject else: author = "Unknown"