fixup! Actually look at input directory
This commit is contained in:
parent
5117bd7782
commit
03e201e6a2
1 changed files with 1 additions and 24 deletions
|
@ -1,4 +1,5 @@
|
|||
import asyncio
|
||||
from aiofiles.os import os as async_os
|
||||
import logging
|
||||
import tempfile
|
||||
import os
|
||||
|
@ -13,26 +14,6 @@ from techrec.http_retriever import download
|
|||
logger = logging.getLogger("forge")
|
||||
Validator = Callable[[datetime, datetime, str], bool]
|
||||
|
||||
|
||||
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)
|
||||
"""
|
||||
repo = get_config()["AUDIO_INPUT"]
|
||||
path = os.path.join(
|
||||
repo, time.strftime(get_config()["AUDIO_INPUT_FORMAT"])
|
||||
)
|
||||
if path.startswith("http://") or path.startswith("https://"):
|
||||
logger.info(f"downloading: {path}")
|
||||
local = await download(
|
||||
path,
|
||||
basic_auth=get_config()['AUDIO_INPUT_BASICAUTH'],
|
||||
)
|
||||
return local
|
||||
return path
|
||||
|
||||
|
||||
def round_timefile(exact: datetime) -> datetime:
|
||||
"""
|
||||
This will round the datetime, so to match the file organization structure
|
||||
|
@ -134,10 +115,6 @@ class DirBackend(InputBackend):
|
|||
|
||||
class HttpBackend(InputBackend):
|
||||
async def get_file(uri: str) -> str:
|
||||
"""
|
||||
time is not "rounded" to match the real file;
|
||||
that work is done in get_timefile(time)
|
||||
"""
|
||||
self.log.info(f"downloading: {uri}")
|
||||
local = await download(
|
||||
uri,
|
||||
|
|
Loading…
Reference in a new issue