mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2025-02-22 16:00:15 +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
|
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]:
|
def get_config_env() -> ConfigType | Literal[False]:
|
||||||
"""read config from environment"""
|
"""read config from environment"""
|
||||||
if "TA_URL" in os.environ:
|
if "TA_URL" in os.environ:
|
||||||
@ -44,9 +38,7 @@ def get_config_env() -> ConfigType | Literal[False]:
|
|||||||
"ta_token": os.environ["TA_TOKEN"],
|
"ta_token": os.environ["TA_TOKEN"],
|
||||||
"jf_url": os.environ["JF_URL"],
|
"jf_url": os.environ["JF_URL"],
|
||||||
"jf_token": os.environ["JF_TOKEN"],
|
"jf_token": os.environ["JF_TOKEN"],
|
||||||
"jf_folder": get_variable_or_default(
|
"jf_folder": os.environ.get("JF_FOLDER", "youtube"),
|
||||||
os.environ["JF_FOLDER"], "youtube"
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
return config_content
|
return config_content
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user