|
|
@ -43,7 +43,7 @@ from werkzeug.exceptions import default_exceptions
|
|
|
|
from werkzeug.datastructures import Headers
|
|
|
|
from werkzeug.datastructures import Headers
|
|
|
|
from werkzeug.security import generate_password_hash, check_password_hash
|
|
|
|
from werkzeug.security import generate_password_hash, check_password_hash
|
|
|
|
|
|
|
|
|
|
|
|
from . import constants, logger, isoLanguages, services, worker
|
|
|
|
from . import constants, config, logger, isoLanguages, services, worker
|
|
|
|
from . import searched_ids, lm, babel, db, ub, config, get_locale, app
|
|
|
|
from . import searched_ids, lm, babel, db, ub, config, get_locale, app
|
|
|
|
from .gdriveutils import getFileFromEbooksFolder, do_gdrive_download
|
|
|
|
from .gdriveutils import getFileFromEbooksFolder, do_gdrive_download
|
|
|
|
from .helper import common_filters, get_search_results, fill_indexpage, speaking_language, check_valid_domain, \
|
|
|
|
from .helper import common_filters, get_search_results, fill_indexpage, speaking_language, check_valid_domain, \
|
|
|
@ -93,12 +93,11 @@ def error_http(error):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def internal_error(error):
|
|
|
|
def internal_error(error):
|
|
|
|
__, __, tb = sys.exc_info()
|
|
|
|
|
|
|
|
return render_template('http_error.html',
|
|
|
|
return render_template('http_error.html',
|
|
|
|
error_code="Internal Server Error",
|
|
|
|
error_code="Internal Server Error",
|
|
|
|
error_name=str(error),
|
|
|
|
error_name=str(error),
|
|
|
|
issue=True,
|
|
|
|
issue=True,
|
|
|
|
error_stack=traceback.format_tb(tb),
|
|
|
|
error_stack=traceback.format_exc().split("\n"),
|
|
|
|
instance=config.config_calibre_web_title
|
|
|
|
instance=config.config_calibre_web_title
|
|
|
|
), 500
|
|
|
|
), 500
|
|
|
|
|
|
|
|
|
|
|
@ -791,9 +790,7 @@ def get_tasks_status():
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/reconnect")
|
|
|
|
@app.route("/reconnect")
|
|
|
|
def reconnect():
|
|
|
|
def reconnect():
|
|
|
|
db.session.close()
|
|
|
|
db.reconnect_db(config)
|
|
|
|
db.engine.dispose()
|
|
|
|
|
|
|
|
db.setup_db()
|
|
|
|
|
|
|
|
return json.dumps({})
|
|
|
|
return json.dumps({})
|
|
|
|
|
|
|
|
|
|
|
|
@web.route("/search", methods=["GET"])
|
|
|
|
@web.route("/search", methods=["GET"])
|
|
|
@ -985,10 +982,7 @@ def render_read_books(page, are_read, as_xml=False, order=None):
|
|
|
|
entries, random, pagination = fill_indexpage(page, db.Books, db_filter, order)
|
|
|
|
entries, random, pagination = fill_indexpage(page, db.Books, db_filter, order)
|
|
|
|
|
|
|
|
|
|
|
|
if as_xml:
|
|
|
|
if as_xml:
|
|
|
|
xml = render_title_template('feed.xml', entries=entries, pagination=pagination)
|
|
|
|
return entries, pagination
|
|
|
|
response = make_response(xml)
|
|
|
|
|
|
|
|
response.headers["Content-Type"] = "application/xml; charset=utf-8"
|
|
|
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if are_read:
|
|
|
|
if are_read:
|
|
|
|
name = _(u'Read Books') + ' (' + str(len(readBookIds)) + ')'
|
|
|
|
name = _(u'Read Books') + ' (' + str(len(readBookIds)) + ')'
|
|
|
|