Added support for PWA

This commit is contained in:
CasVT
2024-03-03 13:40:08 +01:00
parent a0f9637101
commit ae17c62ad3
6 changed files with 71 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ from backend.custom_exceptions import (AccessUnauthorized, InvalidDatabaseFile,
from backend.helpers import RestartVars, folder_path
DB_FILENAME = 'db', 'MIND.db'
__DATABASE_VERSION__ = 9
__DATABASE_VERSION__ = 10
__DATEBASE_NAME_ORIGINAL__ = "MIND_original.db"
class DB_Singleton(type):
@@ -283,6 +283,22 @@ def migrate_db(current_db_version: int) -> None:
current_db_version = 9
if current_db_version == 9:
# V9 -> V10
# Nothing is changed in the database
# It's just that this code needs to run once
# and the DB migration system does exactly that:
# run pieces of code once.
from backend.settings import update_manifest
url_prefix: str = cursor.execute(
"SELECT value FROM config WHERE key = 'url_prefix' LIMIT 1;"
).fetchone()[0]
update_manifest(url_prefix)
current_db_version = 10
return
def setup_db() -> None: