removal of hard codeing
This commit is contained in:
+12
-4
@@ -65,7 +65,7 @@ class TimezoneAwareFormatter(logging.Formatter):
|
||||
|
||||
def _setup_file_logging():
|
||||
"""Setup file logging for NFOGuard"""
|
||||
log_dir = Path("/app/data/logs")
|
||||
log_dir = Path(os.environ.get("LOG_DIR", "/app/data/logs"))
|
||||
log_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
logger = logging.getLogger("NFOGuard")
|
||||
@@ -200,9 +200,17 @@ def _bool_env(name: str, default: bool) -> bool:
|
||||
|
||||
class NFOGuardConfig:
|
||||
def __init__(self):
|
||||
# Paths
|
||||
self.tv_paths = [Path(p.strip()) for p in os.environ.get("TV_PATHS", "/media/tv,/media/tv6").split(",") if p.strip()]
|
||||
self.movie_paths = [Path(p.strip()) for p in os.environ.get("MOVIE_PATHS", "/media/movies,/media/movies6").split(",") if p.strip()]
|
||||
# Paths - No hardcoded defaults, must be configured via environment
|
||||
tv_paths_env = os.environ.get("TV_PATHS", "")
|
||||
movie_paths_env = os.environ.get("MOVIE_PATHS", "")
|
||||
|
||||
if not tv_paths_env:
|
||||
raise ValueError("TV_PATHS environment variable is required but not set")
|
||||
if not movie_paths_env:
|
||||
raise ValueError("MOVIE_PATHS environment variable is required but not set")
|
||||
|
||||
self.tv_paths = [Path(p.strip()) for p in tv_paths_env.split(",") if p.strip()]
|
||||
self.movie_paths = [Path(p.strip()) for p in movie_paths_env.split(",") if p.strip()]
|
||||
|
||||
# Core settings
|
||||
self.manage_nfo = _bool_env("MANAGE_NFO", True)
|
||||
|
||||
Reference in New Issue
Block a user