mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +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:
+7
-12
@@ -3,14 +3,10 @@ This module contains functions for the server
|
||||
"""
|
||||
import time
|
||||
|
||||
from app.logger import log
|
||||
from app.lib.populate import Populate, PopulateCancelledError
|
||||
|
||||
from app.utils.generators import get_random_str
|
||||
from app.utils.network import Ping
|
||||
from app.utils.threading import background
|
||||
|
||||
from app.settings import ParserFlags, get_flag, get_scan_sleep_time
|
||||
from app.utils.generators import get_random_str
|
||||
from app.utils.threading import background
|
||||
|
||||
|
||||
@background
|
||||
@@ -21,14 +17,13 @@ def run_periodic_scans():
|
||||
# ValidateAlbumThumbs()
|
||||
# ValidatePlaylistThumbs()
|
||||
|
||||
try:
|
||||
Populate(key=get_random_str())
|
||||
except PopulateCancelledError:
|
||||
pass
|
||||
run_periodic_scan = True
|
||||
|
||||
while run_periodic_scan:
|
||||
run_periodic_scan = get_flag(ParserFlags.DO_PERIODIC_SCANS)
|
||||
|
||||
while get_flag(ParserFlags.DO_PERIODIC_SCANS):
|
||||
try:
|
||||
Populate(key=get_random_str())
|
||||
Populate(instance_key=get_random_str())
|
||||
except PopulateCancelledError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user