From 87a0bec85d9b9d8ea1e9c7057609634ed889f675 Mon Sep 17 00:00:00 2001 From: Parker Date: Mon, 20 Jan 2025 21:29:36 -0600 Subject: Add public_url field for Jellyfin acc. creation --- code/utils/config.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'code/utils/config.py') 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 -- cgit v1.2.3-70-g09d2