rewrite populate.py to minimize db and hdd reads

+ change process name in manage.py
+ update db query to save show albums as single, as an integer
+ enable periodic scans
+ misc
This commit is contained in:
mungai-njoroge
2023-09-11 11:37:36 +03:00
parent e9284de91f
commit bacf68248b
10 changed files with 143 additions and 19 deletions
+7
View File
@@ -5,6 +5,7 @@ import logging
import mimetypes
import os
import setproctitle
from flask import request
from app.api import create_api
@@ -18,6 +19,7 @@ from app.utils.filesystem import get_home_res_path
from app.utils.threading import background
mimetypes.add_type("text/css", ".css")
mimetypes.add_type("text/javascript", ".js")
mimetypes.add_type("text/plain", ".txt")
mimetypes.add_type("text/html", ".html")
@@ -76,6 +78,11 @@ def start_watchdog():
WatchDog().run()
setproctitle.setproctitle(
f"swingmusic - {FLASKVARS.FLASK_HOST}:{FLASKVARS.FLASK_PORT}"
)
if __name__ == "__main__":
HandleArgs()
log_startup_info()