Fix unbounded variables

This commit is contained in:
Blallo 2021-09-17 10:20:59 +02:00
parent fd1e5df655
commit 1ee4ca8eb8
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -19,15 +19,15 @@ async def get_timefile_exact(time) -> str:
time is of type `datetime`; it is not "rounded" to match the real file;
that work is done in get_timefile(time)
"""
remote_repo = get_config()["AUDIO_INPUT"]
remote_path = os.path.join(
remote_repo, time.strftime(get_config()["AUDIO_INPUT_FORMAT"])
repo = get_config()["AUDIO_INPUT"]
path = os.path.join(
repo, time.strftime(get_config()["AUDIO_INPUT_FORMAT"])
)
if remote_path.startswith("http://") or remote_path.startswith("https://"):
logger.info(f"downloading: {remote_path}")
local = await download(remote_path)
if path.startswith("http://") or path.startswith("https://"):
logger.info(f"downloading: {path}")
local = await download(path)
return local
return local_path
return path
def round_timefile(exact: datetime) -> datetime: