feat: Refactor backup and sync paths, enhance configuration flexibility

This commit is contained in:
2025-12-15 10:45:28 +09:00
parent 834e21b331
commit 9ddc0d9eb2
6 changed files with 148 additions and 79 deletions
+8 -2
View File
@@ -7,11 +7,17 @@ from app.utils.config import server_config
from app.utils.local_playlist import load_local_playlist
from app.utils.plex_client import plex_client
# Default backup directory
BACKUP_DIR = os.path.abspath(
# Default backup directory (repo root /backups)
DEFAULT_BACKUP_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "..", "backups")
)
# Allow Docker / users to relocate backups for centralized host backup.
# Example: /app/data/backup
BACKUP_DIR = os.path.abspath(
os.environ.get("PLEXPLAYLISTSYNC_BACKUP_DIR", DEFAULT_BACKUP_DIR)
)
def ensure_backup_dir():
"""Ensure the backup directory exists."""