From dc5074a86574cb77b376da3408ef5837fd951daa Mon Sep 17 00:00:00 2001 From: Pavel Yakunin Date: Sun, 5 Jun 2016 19:52:28 +0300 Subject: [PATCH] default upload logic --- cps/book_formats.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cps/book_formats.py b/cps/book_formats.py index fa1808fe..b656fa02 100644 --- a/cps/book_formats.py +++ b/cps/book_formats.py @@ -21,7 +21,21 @@ except ImportError, e: def process(tmp_file_path, original_file_name, original_file_extension): if (".PDF" == original_file_extension.upper()): return pdf_meta(tmp_file_path, original_file_name, original_file_extension) - else: return None + else: return default_meta(tmp_file_path, original_file_name, original_file_extension) + + + +def default_meta(tmp_file_path, original_file_name, original_file_extension): + return uploader.BookMeta( + file_path = tmp_file_path, + extension = original_file_extension, + title = original_file_name, + author = "Unknown", + cover = None, + description = "", + tags = "", + series = "", + series_id="") def pdf_meta(tmp_file_path, original_file_name, original_file_extension):