diff --git a/src/main.py b/src/main.py index d6af54c..8009530 100644 --- a/src/main.py +++ b/src/main.py @@ -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():