1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-28 05:47:43 +00:00

Config Options for limiting email size, change username to e-mail adress, use kepubify

Added work on Unrar5 decompression (breaks comic reader totally)
This commit is contained in:
Ozzieisaacs
2020-05-04 18:19:30 +02:00
parent 0adcd1b3d9
commit e1439b529b
7 changed files with 1411 additions and 26 deletions

View File

@@ -30,7 +30,6 @@ from uuid import uuid4
from flask import Blueprint, request, flash, redirect, url_for, abort, Markup, Response
from flask_babel import gettext as _
from flask_login import current_user, login_required
from sqlalchemy import func
from . import constants, logger, isoLanguages, gdriveutils, uploader, helper
from . import config, get_locale, db, ub, worker
@@ -182,6 +181,8 @@ def delete_book(book_id, book_format):
if not result:
flash(error, category="error")
return redirect(url_for('editbook.edit_book', book_id=book_id))
if error:
flash(error, category="warning")
if not book_format:
# delete book from Shelfs, Downloads, Read list
ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book_id).delete()
@@ -689,6 +690,15 @@ def upload():
flash(_(u"Uploaded book probably exists in the library, consider to change before upload new: ")
+ Markup(render_title_template('book_exists_flash.html', entry=entry)), category="warning")
# handle authors
is_author = db.session.query(db.Authors).filter(db.Authors.name == authr).first()
if is_author:
db_author = is_author
authr= is_author.name
else:
db_author = db.Authors(authr, helper.get_sorted_author(authr), "")
db.session.add(db_author)
title_dir = helper.get_valid_filename(title)
author_dir = helper.get_valid_filename(authr)
filepath = os.path.join(config.config_calibre_dir, author_dir, title_dir)
@@ -722,14 +732,6 @@ def upload():
else:
has_cover = 1
# handle authors
is_author = db.session.query(db.Authors).filter(db.Authors.name == func.binary(authr)).first()
if is_author:
db_author = is_author
else:
db_author = db.Authors(authr, helper.get_sorted_author(authr), "")
db.session.add(db_author)
# handle series
db_series = None
is_series = db.session.query(db.Series).filter(db.Series.name == series).first()