major styling pass, artist list, and import processing improvements

This commit is contained in:
Bryan Van Deusen
2025-07-31 23:48:37 -04:00
parent 48aa60b9ea
commit e3a4c348f1
17 changed files with 454 additions and 111 deletions
+8 -8
View File
@@ -5,26 +5,26 @@ class Config:
DB_TYPE = os.environ.get('DB_TYPE', 'sqlite').lower() # 'sqlite' or 'postgresql'
if DB_TYPE == 'postgresql':
DB_USER = os.environ.get('DB_USER', 'postgres')
DB_USER = os.environ.get('DB_USER', 'imagerepo')
DB_PASS = os.environ.get('DB_PASS', 'postgres')
DB_HOST = os.environ.get('DB_HOST', 'localhost')
DB_HOST = os.environ.get('DB_HOST', 'postgres')
DB_PORT = os.environ.get('DB_PORT', '5432')
DB_NAME = os.environ.get('DB_NAME', 'postgres')
DB_NAME = os.environ.get('DB_NAME', 'imagerepo')
SQLALCHEMY_DATABASE_URI = (
f'postgresql://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}'
)
elif DB_TYPE == 'sqlite':
BASEDIR = os.path.abspath(os.path.dirname(__file__))
DB_DIR = '/db'
os.makedirs(DB_DIR, exist_ok=True) # only works if /db is writable
DB_NAME = os.environ.get('DB_NAME', 'app.db')
SQLALCHEMY_DATABASE_URI = f'sqlite:///{os.path.join(BASEDIR, DB_NAME)}'
SQLALCHEMY_DATABASE_URI = f'sqlite:///{os.path.join(DB_DIR, DB_NAME)}'
else:
raise ValueError(f"Unsupported DB_TYPE '{DB_TYPE}'. Use 'sqlite' or 'postgresql'.")
SQLALCHEMY_TRACK_MODIFICATIONS = False
CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'