feat: Refactor backup and sync paths, enhance configuration flexibility
This commit is contained in:
+8
-2
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user