default upload logic

pull/30/head
Pavel Yakunin 9 years ago
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…
Cancel
Save