mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 02:59:27 +00:00
added not list folders
This commit is contained in:
@@ -19,7 +19,13 @@ _FAVICON = "favicon.ico"
|
||||
_AUTHOR = "Author"
|
||||
imgext = [".jpg", ".jpeg"]
|
||||
rawext = [".3fr", ".ari", ".arw", ".bay", ".braw", ".crw", ".cr2", ".cr3", ".cap", ".data", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".fff", ".gpr", ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx", ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".tif", ".tiff", ".x3f"]
|
||||
excludes = [".lock", _FAVICON, "index.html", "Galleries", ".previews", "Archives"]
|
||||
excludes = [
|
||||
".lock",
|
||||
_FAVICON,
|
||||
"index.html",
|
||||
".previews",
|
||||
]
|
||||
notlist = ["Galleries", "Archives"]
|
||||
|
||||
thumbnails: list[tuple[str, str]] = []
|
||||
|
||||
@@ -243,6 +249,7 @@ def listfolder(folder: str, title: str):
|
||||
if item not in excludes:
|
||||
if os.path.isdir(os.path.join(folder, item)):
|
||||
subfolders.extend([f'<figure><a href="{args.webroot}{urllib.parse.quote(folder.removeprefix(args.root))}/{urllib.parse.quote(item)}"><img src="{args.foldericon}" alt="Folder icon"/></a><figcaption><a href="{args.webroot}{urllib.parse.quote(folder.removeprefix(args.root))}/{urllib.parse.quote(item)}">{item}</a></figcaption></figure>'])
|
||||
if item not in notlist:
|
||||
listfolder(os.path.join(folder, item), os.path.join(folder, item).removeprefix(args.root))
|
||||
else:
|
||||
if not args.non_interactive:
|
||||
@@ -321,6 +328,7 @@ def gettotal(folder):
|
||||
total += 1
|
||||
if not args.non_interactive:
|
||||
pbar.update(1)
|
||||
if item not in notlist:
|
||||
gettotal(os.path.join(folder, item))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user