Relace function with builtin

This commit is contained in:
CommanderRedYT 2023-12-21 11:31:40 +01:00
parent fccf9c865a
commit 8b70df5f93
No known key found for this signature in database
GPG Key ID: 572F157519DC8A5E
1 changed files with 1 additions and 9 deletions

View File

@ -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