mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2024-11-16 17:00:14 +00:00
Relace function with builtin
This commit is contained in:
parent
fccf9c865a
commit
8b70df5f93
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user