From de66ad01c7dce558311235915bb59d0d73220372 Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Mon, 23 Feb 2026 10:52:25 +0100 Subject: [PATCH] fixed media preview --- frontend/app.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 9390718..5c28ad5 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1104,10 +1104,12 @@ function noteApp() { // Handle media files separately - build media lookup map if (note.type !== 'note') { - // Map filename (case-insensitive) to full path + // Map filename WITH extension (case-insensitive) to full path + // Use path to get filename with extension (note.name is stem without extension) + const filenameWithExt = path.split('/').pop().toLowerCase(); // First match wins if there are duplicates - if (!this._mediaLookup.has(nameLower)) { - this._mediaLookup.set(nameLower, path); + if (!this._mediaLookup.has(filenameWithExt)) { + this._mediaLookup.set(filenameWithExt, path); } continue; }