wtf this was not supposed to happen

This commit is contained in:
2024-06-28 21:29:59 +02:00
parent c9436b51b2
commit 095e8384a5

View File

@@ -58,6 +58,7 @@ def listfolder(folder: str, title: str):
foldername = folder.removeprefix(args.root)
if foldername != "":
foldername += "/"
baseurl = urllib.parse.quote(foldername)
if not os.path.exists(os.path.join(args.root, ".thumbnails", foldername)):
os.mkdir(os.path.join(args.root, ".thumbnails", foldername))
@@ -66,12 +67,11 @@ def listfolder(folder: str, title: str):
for item in items:
if item not in excludes:
if os.path.isdir(os.path.join(folder, item)):
subfolder = {"url": f"{args.webroot}{urllib.parse.quote(foldername)}{urllib.parse.quote(item)}", "name": item}
subfolder = {"url": f"{args.webroot}{baseurl}{urllib.parse.quote(item)}", "name": item}
subfolders.extend([subfolder])
if item not in notlist:
listfolder(os.path.join(folder, item), os.path.join(folder, item).removeprefix(args.root))
else:
baseurl = urllib.parse.quote(foldername) + urllib.parse.quote(item)
extsplit = os.path.splitext(item)
if not args.non_interactive:
pbar.desc = f"Generating html files - {folder}"