From d7da93e814b280ffe3568e30ba7c5c5fafd9c8a1 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Thu, 5 Feb 2026 16:25:11 -0800 Subject: [PATCH] Remove redundant code... - `src` is now normalized in advance. - There's no ending `/` to remove because it's a file. --- javascript/gallery.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index ecb3750c0..44045cc4d 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -419,9 +419,7 @@ class GalleryFile extends HTMLElement { } } - // Normalize path to ensure consistent hash regardless of which folder view is used - const normalizedPath = this.src.replace(/\/+/g, '/').replace(/\/$/, ''); - this.hash = await getHash(`${normalizedPath}/${this.size}/${this.mtime}`); // eslint-disable-line no-use-before-define + this.hash = await getHash(`${this.src}/${this.size}/${this.mtime}`); // eslint-disable-line no-use-before-define const cachedData = (this.hash && opts.browser_cache) ? await idbGet(this.hash).catch(() => undefined) : undefined; const img = document.createElement('img'); img.className = 'gallery-file';