fixed media preview

This commit is contained in:
Gamosoft 2026-02-23 10:52:25 +01:00
parent 0fa43ea96c
commit de66ad01c7
1 changed files with 5 additions and 3 deletions

View File

@ -1104,10 +1104,12 @@ function noteApp() {
// Handle media files separately - build media lookup map // Handle media files separately - build media lookup map
if (note.type !== 'note') { 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 // First match wins if there are duplicates
if (!this._mediaLookup.has(nameLower)) { if (!this._mediaLookup.has(filenameWithExt)) {
this._mediaLookup.set(nameLower, path); this._mediaLookup.set(filenameWithExt, path);
} }
continue; continue;
} }