From 03e201e6a2e8b7b10f2de299ddecad21d9cf8b8d Mon Sep 17 00:00:00 2001 From: boyska Date: Fri, 31 Mar 2023 02:21:14 +0200 Subject: [PATCH] fixup! Actually look at input directory --- techrec/forge.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/techrec/forge.py b/techrec/forge.py index e027739..bbc531d 100644 --- a/techrec/forge.py +++ b/techrec/forge.py @@ -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,