aboutsummaryrefslogtreecommitdiff
path: root/code/utils/config.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2025-01-20 21:29:36 -0600
committerParker <contact@pkrm.dev>2025-01-20 21:29:36 -0600
commit87a0bec85d9b9d8ea1e9c7057609634ed889f675 (patch)
tree66b23c7ce9ae0d9db0913ecae01cf8cd9a223b2e /code/utils/config.py
parenta7a9a329840dd42089146d3ee5d258ad5fc9ec4e (diff)
Add public_url field for Jellyfin acc. creation
Diffstat (limited to 'code/utils/config.py')
-rw-r--r--code/utils/config.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/code/utils/config.py b/code/utils/config.py
index c6d107e..1e7fdc6 100644
--- a/code/utils/config.py
+++ b/code/utils/config.py
@@ -44,6 +44,7 @@ JELLYFIN_URL = None
JELLYFIN_HEADERS = None
ACCOUNT_TIME = None
SIMPLE_PASSWORDS = False
+JELLYFIN_PUBLIC_URL = None
schema = {
"type": "object",
@@ -89,8 +90,16 @@ schema = {
"url": {"type": "string"},
"api_key": {"type": "string"},
"account_time": {"type": "integer"},
+ "simple_passwords": {"type": "boolean"},
+ "public_url": {"type": "string"},
},
- "required": ["url", "api_key", "account_time"],
+ "required": [
+ "url",
+ "api_key",
+ "account_time",
+ "simple_passwords",
+ "public_url",
+ ],
},
},
"required": ["bot_info", "radarr", "sonarr"],
@@ -175,7 +184,7 @@ def validate_config(contents) -> None:
Args:
contents (str): The contents of the config file
"""
- global BOT_TOKEN, RADARR_HOST_URL, RADARR_ENABLED, RADARR_HEADERS, RADARR_ROOT_FOLDER_PATH, RADARR_QUALITY_PROFILE_ID, SONARR_ENABLED, SONARR_HOST_URL, SONARR_HEADERS, SONARR_ROOT_FOLDER_PATH, SONARR_QUALITY_PROFILE_ID, JELLYFIN_ENABLED, JELLYFIN_URL, JELLYFIN_HEADERS, ACCOUNT_TIME, SIMPLE_PASSWORDS
+ global BOT_TOKEN, RADARR_HOST_URL, RADARR_ENABLED, RADARR_HEADERS, RADARR_ROOT_FOLDER_PATH, RADARR_QUALITY_PROFILE_ID, SONARR_ENABLED, SONARR_HOST_URL, SONARR_HEADERS, SONARR_ROOT_FOLDER_PATH, SONARR_QUALITY_PROFILE_ID, JELLYFIN_ENABLED, JELLYFIN_URL, JELLYFIN_HEADERS, ACCOUNT_TIME, SIMPLE_PASSWORDS, JELLYFIN_PUBLIC_URL
config = yaml.safe_load(contents)
@@ -224,6 +233,7 @@ def validate_config(contents) -> None:
}
ACCOUNT_TIME = config["jellyfin"]["account_time"]
SIMPLE_PASSWORDS = config["jellyfin"]
+ JELLYFIN_PUBLIC_URL = config["jellyfin"]["public_url"]
JELLYFIN_ENABLED = True