|
|
|
@ -3174,10 +3174,10 @@ def upload():
|
|
|
|
|
if not config.config_uploading:
|
|
|
|
|
abort(404)
|
|
|
|
|
# create the function for sorting...
|
|
|
|
|
if request.method == 'POST' and 'btn-upload' in request.files:
|
|
|
|
|
for requested_file in request.files.getlist("btn-upload"):
|
|
|
|
|
db.session.connection().connection.connection.create_function("title_sort", 1, db.title_sort)
|
|
|
|
|
db.session.connection().connection.connection.create_function('uuid4', 0, lambda: str(uuid4()))
|
|
|
|
|
if request.method == 'POST' and 'btn-upload' in request.files:
|
|
|
|
|
requested_file = request.files['btn-upload']
|
|
|
|
|
if '.' in requested_file.filename:
|
|
|
|
|
file_ext = requested_file.filename.rsplit('.', 1)[-1].lower()
|
|
|
|
|
if file_ext not in ALLOWED_EXTENSIONS:
|
|
|
|
@ -3285,17 +3285,16 @@ def upload():
|
|
|
|
|
author_names.append(author.name)
|
|
|
|
|
if config.config_use_google_drive:
|
|
|
|
|
updateGdriveCalibreFromLocal()
|
|
|
|
|
if len(request.files.getlist("btn-upload")) < 2:
|
|
|
|
|
cc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all()
|
|
|
|
|
if current_user.role_edit() or current_user.role_admin():
|
|
|
|
|
return render_title_template('book_edit.html', book=db_book, authors=author_names, cc=cc,
|
|
|
|
|
title=_(u"edit metadata"))
|
|
|
|
|
return render_title_template('book_edit.html', book=db_book, authors=author_names, cc=cc,title=_(u"edit metadata"))
|
|
|
|
|
book_in_shelfs = []
|
|
|
|
|
return render_title_template('detail.html', entry=db_book, cc=cc, title=db_book.title,
|
|
|
|
|
books_shelfs=book_in_shelfs, )
|
|
|
|
|
return render_title_template('detail.html', entry=db_book, cc=cc, title=db_book.title, books_shelfs=book_in_shelfs, )
|
|
|
|
|
return redirect(url_for("index"))
|
|
|
|
|
else:
|
|
|
|
|
return redirect(url_for("index"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start_gevent():
|
|
|
|
|
from gevent.wsgi import WSGIServer
|
|
|
|
|
global gevent_server
|
|
|
|
|