change config bools

This commit is contained in:
Nathan
2025-11-10 10:24:55 -07:00
parent cef84c68b9
commit 5c5e22cfb7
3 changed files with 713 additions and 4 deletions

View File

@@ -33,8 +33,9 @@ SEQUENCE_EXTENSIONS = {
STATE_SUFFIX = ".meta.json"
CONFIG_PATH = Path(__file__).resolve().with_name("config.json")
DEFAULT_CONFIG = {
"zipper": True,
"zipper": "7z",
"compression": 9,
"dailyFormat": "daily_YYMMDD",
}
@@ -60,7 +61,13 @@ def load_config() -> dict:
CONFIG = load_config()
USE_7Z = bool(CONFIG.get("zipper", True))
zipper_val = CONFIG.get("zipper", "7z")
# Handle both old boolean format and new string format
if isinstance(zipper_val, bool):
ZIPPER_TYPE = "7z" if zipper_val else "zip"
else:
ZIPPER_TYPE = str(zipper_val).lower()
USE_7Z = ZIPPER_TYPE == "7z"
COMPRESSION_LEVEL = CONFIG.get("compression", 9)
if isinstance(COMPRESSION_LEVEL, str):
try: