From 915bcab3c2bf37553fca2712e332575f9a09d581 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Tue, 3 Feb 2026 12:25:41 -0800 Subject: [PATCH 1/2] Fix incorrect data handling Partial reversion of commit c07eddb58da813740fb59860ccc3b2f64321b3ef --- javascript/gallery.js | 4 +--- wiki | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index 9a7bc9579..f72ddc29f 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -456,11 +456,9 @@ class GalleryFile extends HTMLElement { this.size = json.size; this.mtime = new Date(json.mtime); if (opts.browser_cache) { - // Store file's actual parent directory (not browsed folder) for consistent cleanup - const fileDir = this.src.replace(/\/+/g, '/').replace(/\/[^/]+$/, ''); await idbAdd({ hash: this.hash, - folder: fileDir, + folder: this.folder, file: this.name, size: this.size, mtime: this.mtime, diff --git a/wiki b/wiki index e4b53a6d3..a678731c5 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit e4b53a6d367b4477323cdb171d6bdddf973758a1 +Subproject commit a678731c5da5d77f7c21edf7f1d62d8307d0d7fe From c4de8fb1cca136315ae88f97c83c82c9655fdd5d Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:15:21 -0800 Subject: [PATCH 2/2] Do not make changes to the index's primary key - Values should not be modified in `indexdb.js` --- javascript/indexdb.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/javascript/indexdb.js b/javascript/indexdb.js index 3bac20089..81c165f74 100644 --- a/javascript/indexdb.js +++ b/javascript/indexdb.js @@ -185,10 +185,7 @@ async function idbFolderCleanup(keepSet, folder, signal) { throw new Error('IndexedDB cleaning function must be told the current active folder'); } - // Use range query to match folder and all its subdirectories - const folderNormalized = folder.replace(/\/+/g, '/').replace(/\/$/, ''); - const range = IDBKeyRange.bound(folderNormalized, `${folderNormalized}\uffff`, false, true); - let removals = new Set(await idbGetAllKeys('folder', range)); + let removals = new Set(await idbGetAllKeys('folder', folder)); removals = removals.difference(keepSet); // Don't need to keep full set in memory const totalRemovals = removals.size; if (signal.aborted) {