mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
break settings.py into classes
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ def get_folder_tree():
|
||||
|
||||
try:
|
||||
if req_dir == "$home" and root_dirs[0] == "$home":
|
||||
req_dir = settings.USER_HOME_DIR
|
||||
req_dir = settings.Paths.USER_HOME_DIR
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ from pathlib import Path
|
||||
|
||||
from flask import Blueprint, send_from_directory
|
||||
|
||||
from app.settings import APP_DIR
|
||||
from app.settings import Paths
|
||||
|
||||
api = Blueprint("imgserver", __name__, url_prefix="/img")
|
||||
SUPPORTED_IMAGES = (".jpg", ".png", ".webp", ".jpeg")
|
||||
|
||||
APP_DIR = Path(APP_DIR)
|
||||
APP_DIR = Path(Paths.APP_DIR)
|
||||
IMG_PATH = APP_DIR / "images"
|
||||
ASSETS_PATH = APP_DIR / "assets"
|
||||
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ def add_root_dirs():
|
||||
sdb.remove_root_dirs(db_dirs)
|
||||
|
||||
if incoming_home:
|
||||
finalize([_h], [], [settings.USER_HOME_DIR])
|
||||
finalize([_h], [], [settings.Paths.USER_HOME_DIR])
|
||||
return {"root_dirs": [_h]}
|
||||
|
||||
# ---
|
||||
|
||||
Reference in New Issue
Block a user