3 Commits

Author SHA1 Message Date
48950d1d82 fixed url flicker 2025-06-27 00:18:46 +02:00
e1d74c3091 hm... 2025-06-27 00:03:35 +02:00
f57d81f508 hotfix 2025-06-26 23:21:01 +02:00
8 changed files with 19 additions and 31 deletions

View File

@@ -1 +1 @@
2.8.0
2.8.1

View File

@@ -91,7 +91,6 @@
"--exclude-folder",
"*/Galleries/*",
"--folderthumbnails",
"--reread-metadata"
],
"console": "integratedTerminal",
"name": "production",

View File

@@ -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 []
def list_folder(folder: str, title: str, _args: Args, raw: list[str], version: str, logo: str) -> list[tuple[str, str, str]]:

View File

@@ -174,7 +174,6 @@
let shown = [];
let subfolders = [];
let controllers = {};
let currentFolder = "";
function requestMetadata() {
fetch(".metadata.json").then(response => {
@@ -196,12 +195,6 @@
var pid = window.location.href.match(re)[1];
openSwipe(parseInt(pid));
}
if (items == []) {
document.getElementById("imagelist").style.display = "none"
} else {
document.getElementById("imagelist").style.display = ""
}
})
.catch(error => console.error('Failed to fetch data:', error));
}
@@ -225,7 +218,6 @@
folders.style.display = "none";
}
for (const folder of sub) {
currentFolder = folder.name;
try {
const response = await fetch(folder.metadata);
const data = await response.json();
@@ -299,7 +291,8 @@
function filter() {
shown = [];
window.location.href = window.location.href.split("#")[0] + "#";
const curr = window.location.href.split("#")[0] + "#";
const path = window.location.href.split("#")[0].replace("index.html", "");
const selected_tags = [];
const tagcheckboxes = document.querySelectorAll("#tagdropdown input[class='tag']:checked");
@@ -318,26 +311,30 @@
const include = selected_tags.every(tag => tags.some(t => t.startsWith(tag)));
if (include || selected_tags.length === 0) {
if (isRecursiveChecked || item.folder === currentFolder) {
if (!isRecursiveChecked) {
if (item.src.replace(item.name, "") == path) {
shown.push(item);
}
}
else {
shown.push(item);
}
}
}
updateImageList();
window.location.href += urltags;
window.location.href = curr + urltags;
}
function setFilter(selected) {
tagdropdown = document.getElementById("tagdropdown").getElementsByTagName("li");
const tagcheckboxes = document.querySelectorAll("#tagdropdown input[class='tag']");
selected.forEach((tag) => {
for (var i = 0; i < tagdropdown.length; i++) {
if (tagdropdown[i].innerText == tag) {
tagdropdown[i].firstChild.firstChild.checked = true;
}
tagcheckboxes.forEach((checkbox) => {
if (checkbox.parentElement.id.trim().substring(1).replace(" ", "%20") == tag) {
checkbox.checked = true;
}
});
});
}
function onLoad() {

View File

Before

Width:  |  Height:  |  Size: 7.3 MiB

After

Width:  |  Height:  |  Size: 7.3 MiB