1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-24 10:37:23 +00:00

default upload logic

This commit is contained in:
Pavel Yakunin 2016-06-05 19:52:28 +03:00
parent 44df873f33
commit dc5074a865

View File

@ -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):