From 8b70df5f93f28c0f3e48f87360e22ec6251789c9 Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Thu, 21 Dec 2023 11:31:40 +0100 Subject: [PATCH] Relace function with builtin --- app/src/config.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/config.py b/app/src/config.py index 1fbaffd..d30e51f 100644 --- a/app/src/config.py +++ b/app/src/config.py @@ -29,12 +29,6 @@ def get_config_file() -> ConfigType | Literal[False]: return False -def get_variable_or_default(variable: str, default: str) -> str: - if not variable or len(variable) < 1: - return default - return variable - - def get_config_env() -> ConfigType | Literal[False]: """read config from environment""" if "TA_URL" in os.environ: @@ -44,9 +38,7 @@ def get_config_env() -> ConfigType | Literal[False]: "ta_token": os.environ["TA_TOKEN"], "jf_url": os.environ["JF_URL"], "jf_token": os.environ["JF_TOKEN"], - "jf_folder": get_variable_or_default( - os.environ["JF_FOLDER"], "youtube" - ), + "jf_folder": os.environ.get("JF_FOLDER", "youtube"), } return config_content