mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
load settings from db, use api to change settings
+ add route to get all settings + add route to set any setting + add untested migration to add settings into settings db + compress json in api responses using FlaskCompress + serve gziped assets if browser accepts encoded files + misc
This commit is contained in:
+13
-3
@@ -1,11 +1,13 @@
|
||||
"""
|
||||
Prepares the server for use.
|
||||
"""
|
||||
from app.db.sqlite.settings import load_settings
|
||||
from app.setup.files import create_config_dir
|
||||
from app.setup.sqlite import run_migrations, setup_sqlite
|
||||
from app.store.albums import AlbumStore
|
||||
from app.store.artists import ArtistStore
|
||||
from app.store.tracks import TrackStore
|
||||
from app.utils.generators import get_random_str
|
||||
|
||||
|
||||
def run_setup():
|
||||
@@ -13,6 +15,14 @@ def run_setup():
|
||||
setup_sqlite()
|
||||
run_migrations()
|
||||
|
||||
TrackStore.load_all_tracks()
|
||||
AlbumStore.load_albums()
|
||||
ArtistStore.load_artists()
|
||||
try:
|
||||
load_settings()
|
||||
except IndexError:
|
||||
# settings table is empty
|
||||
pass
|
||||
|
||||
instance_key = get_random_str()
|
||||
|
||||
TrackStore.load_all_tracks(instance_key)
|
||||
AlbumStore.load_albums(instance_key)
|
||||
ArtistStore.load_artists(instance_key)
|
||||
|
||||
Reference in New Issue
Block a user