mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 04:19:59 +00:00
default upload logic
This commit is contained in:
parent
44df873f33
commit
dc5074a865
@ -21,7 +21,21 @@ except ImportError, e:
|
|||||||
def process(tmp_file_path, original_file_name, original_file_extension):
|
def process(tmp_file_path, original_file_name, original_file_extension):
|
||||||
if (".PDF" == original_file_extension.upper()):
|
if (".PDF" == original_file_extension.upper()):
|
||||||
return pdf_meta(tmp_file_path, original_file_name, original_file_extension)
|
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):
|
def pdf_meta(tmp_file_path, original_file_name, original_file_extension):
|
||||||
|
Loading…
Reference in New Issue
Block a user