diff --git a/api/advent22_api/core/depends.py b/api/advent22_api/core/depends.py index 22da00a..e3dcb60 100644 --- a/api/advent22_api/core/depends.py +++ b/api/advent22_api/core/depends.py @@ -1,3 +1,4 @@ +import re from datetime import date from io import BytesIO from typing import cast @@ -91,8 +92,14 @@ async def get_all_image_names( Bilder "auto" und "manual" zu Tagen zuordnen """ - # TODO penner - # "manual"-Bilder erkennen (hier neue variable anlegen) + __DIR = "/images_manual" + __RE = re.compile(r"\.jpg$", flags=re.IGNORECASE) + + manual_image_names = await WebDAV.list_files(directory=__DIR, regex=__RE) + + for name in manual_image_names: + zahl = int(__RE.sub(string=name, repl="")) + auto_image_names[zahl] = f"{__DIR}/{name}" return auto_image_names