1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-12-05 15:58:05 +00:00

Initial attempt at setting up CalibreDB as a class that carries the engine and DB connection, and the instance being the session

This commit is contained in:
blitzmann
2020-09-11 22:52:40 -04:00
parent 7929711fea
commit 18d16f9a8b
2 changed files with 91 additions and 66 deletions

View File

@@ -83,6 +83,8 @@ log = logger.create()
from . import services
db.CalibreDB.setup_db(config, cli.settingspath)
calibre_db = db.CalibreDB()
def create_app():
@@ -91,7 +93,7 @@ def create_app():
if sys.version_info < (3, 0):
app.static_folder = app.static_folder.decode('utf-8')
app.root_path = app.root_path.decode('utf-8')
app.instance_path = app.instance_path .decode('utf-8')
app.instance_path = app.instance_path.decode('utf-8')
cache_buster.init_cache_busting(app)
@@ -101,7 +103,6 @@ def create_app():
app.secret_key = os.getenv('SECRET_KEY', config_sql.get_flask_session_key(ub.session))
web_server.init_app(app, config)
calibre_db.setup_db(config, cli.settingspath)
babel.init_app(app)
_BABEL_TRANSLATIONS.update(str(item) for item in babel.list_translations())