core: opti readme search

This commit is contained in:
starnakin 2025-04-14 13:41:33 +02:00
parent a4324c61d0
commit 637e2382b2

View File

@ -50,6 +50,12 @@ def get_updated_folders(path: str):
return updated_folders
def get_readme(folder):
absolut_path: str = os.path.join(folder, "readme.md")
if (os.path.exists(absolut_path)):
return absolut_path
return None
def gen_pages(folders: list[str]):
with Bar("generating...", max=len(folders)) as bar:
for folder in folders:
@ -58,8 +64,7 @@ def gen_pages(folders: list[str]):
raws: list[str] = [file for file in files if file.endswith(".NEF")]
raw: str = raws[0] if len(raws) > 0 else None
exif: str = get_exif(folder, raw)
readmes: list[str] = [file for file in files if file == "readme.md"]
readme: str = readmes[0] if len(readmes) > 0 else None
readme: str = get_readme(folder)
bar.next()
def main():