From e1d74c309109f11847d0fe60e2a754cd242d45d0 Mon Sep 17 00:00:00 2001 From: Flo Greistorfer Date: Fri, 27 Jun 2025 00:03:35 +0200 Subject: [PATCH] hm... --- StaticGalleryBuilder.code-workspace | 1 - modules/generate_html.py | 16 ++++------------ .../000041900001.jpg | Bin .../000041900001.jpg.xmp | 0 .../000041900001.tif | Bin .../000041900001.tif.xmp | 0 6 files changed, 4 insertions(+), 13 deletions(-) rename test/example/subfolder/{subsubfolder => subsubfolder (now with symbols)}/000041900001.jpg (100%) rename test/example/subfolder/{subsubfolder => subsubfolder (now with symbols)}/000041900001.jpg.xmp (100%) rename test/example/subfolder/{subsubfolder => subsubfolder (now with symbols)}/000041900001.tif (100%) rename test/example/subfolder/{subsubfolder => subsubfolder (now with symbols)}/000041900001.tif.xmp (100%) diff --git a/StaticGalleryBuilder.code-workspace b/StaticGalleryBuilder.code-workspace index 207a831..611b306 100644 --- a/StaticGalleryBuilder.code-workspace +++ b/StaticGalleryBuilder.code-workspace @@ -91,7 +91,6 @@ "--exclude-folder", "*/Galleries/*", "--folderthumbnails", - "--reread-metadata" ], "console": "integratedTerminal", "name": "production", diff --git a/modules/generate_html.py b/modules/generate_html.py index 024aab0..f6f8b2b 100644 --- a/modules/generate_html.py +++ b/modules/generate_html.py @@ -406,7 +406,7 @@ def generate_html(folder: str, title: str, _args: Args, raw: list[str], version: contains_files = False images = [] subfolders = [] - subfoldertags = [] + subfoldertags = set() foldername = folder.removeprefix(_args.root_directory) foldername = f"{foldername}/" if foldername else "" baseurl = urllib.parse.quote(foldername) @@ -422,7 +422,7 @@ def generate_html(folder: str, title: str, _args: Args, raw: list[str], version: for item in tqdm(items, total=len(items), desc=f"Getting image infos - {folder}", unit="files", ascii=True, dynamic_ncols=True): if item not in EXCLUDES and not item.startswith("."): if os.path.isdir(os.path.join(folder, item)): - subfoldertags = process_subfolder(item, folder, baseurl, subfolders, _args, raw, version, logo) + subfoldertags.update(process_subfolder(item, folder, baseurl, subfolders, _args, raw, version, logo)) else: contains_files = True if os.path.splitext(item)[1].lower() in _args.file_extensions: @@ -436,7 +436,7 @@ def generate_html(folder: str, title: str, _args: Args, raw: list[str], version: for item in items: if item not in EXCLUDES and not item.startswith("."): if os.path.isdir(os.path.join(folder, item)): - subfoldertags = process_subfolder(item, folder, baseurl, subfolders, _args, raw, version, logo) + subfoldertags.update(process_subfolder(item, folder, baseurl, subfolders, _args, raw, version, logo)) else: contains_files = True if os.path.splitext(item)[1].lower() in _args.file_extensions: @@ -641,15 +641,7 @@ def create_html_file( logger.info("writing html file", extra={"path": html_file}) f.write(content) - if len(subfoldertags) > 1 and len(alltags) > 1: - alltags.update(set(subfoldertags)) - return sorted(alltags) - elif len(subfoldertags) > 1: - return sorted(subfoldertags) - elif len(alltags) > 1: - return sorted(alltags) - else: - return [] + return sorted(alltags) def list_folder(folder: str, title: str, _args: Args, raw: list[str], version: str, logo: str) -> list[tuple[str, str, str]]: diff --git a/test/example/subfolder/subsubfolder/000041900001.jpg b/test/example/subfolder/subsubfolder (now with symbols)/000041900001.jpg similarity index 100% rename from test/example/subfolder/subsubfolder/000041900001.jpg rename to test/example/subfolder/subsubfolder (now with symbols)/000041900001.jpg diff --git a/test/example/subfolder/subsubfolder/000041900001.jpg.xmp b/test/example/subfolder/subsubfolder (now with symbols)/000041900001.jpg.xmp similarity index 100% rename from test/example/subfolder/subsubfolder/000041900001.jpg.xmp rename to test/example/subfolder/subsubfolder (now with symbols)/000041900001.jpg.xmp diff --git a/test/example/subfolder/subsubfolder/000041900001.tif b/test/example/subfolder/subsubfolder (now with symbols)/000041900001.tif similarity index 100% rename from test/example/subfolder/subsubfolder/000041900001.tif rename to test/example/subfolder/subsubfolder (now with symbols)/000041900001.tif diff --git a/test/example/subfolder/subsubfolder/000041900001.tif.xmp b/test/example/subfolder/subsubfolder (now with symbols)/000041900001.tif.xmp similarity index 100% rename from test/example/subfolder/subsubfolder/000041900001.tif.xmp rename to test/example/subfolder/subsubfolder (now with symbols)/000041900001.tif.xmp