From 34e994faf58fd665dc7d9df72017e82aab54c50c Mon Sep 17 00:00:00 2001 From: jcorporation Date: Tue, 8 Oct 2024 19:55:07 +0200 Subject: [PATCH] Fix: Contextmenu for songs #1356 --- CHANGELOG.md | 1 + htdocs/js/views.js | 6 ++++++ htdocs/js/viewsGrid.js | 1 - htdocs/js/viewsList.js | 1 - 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcd8983b0..bd56ac434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This is a small maintenance release. - Feat: New custom Lua function: mympd.splitlines(), mympd.trim(), mympd.read_file() - Upd: Translations - Upd: Mongoose to current master +- Fix: Contextmenu for songs #1356 *** diff --git a/htdocs/js/views.js b/htdocs/js/views.js index 609d88f60..e16b79680 100644 --- a/htdocs/js/views.js +++ b/htdocs/js/views.js @@ -718,4 +718,10 @@ function setEntryData(entry, data) { break; // No Default } + if (data.Thumbnail !== undefined) { + setData(entry, 'cssImageUrl', data.Thumbnail); + } + else { + setData(entry, 'cssImageUrl', getCssImageUri('/assets/coverimage-notavailable')); + } } diff --git a/htdocs/js/viewsGrid.js b/htdocs/js/viewsGrid.js index 2ad902ef3..05856463e 100644 --- a/htdocs/js/viewsGrid.js +++ b/htdocs/js/viewsGrid.js @@ -178,7 +178,6 @@ function updateGrid(obj, list, perCardCallback, createCardBodyCallback, createCa card.appendChild( elCreateEmpty('div', {"class": ["card-title", "cover-loading", "cover-grid", "d-flex"]}) ); - setData(card, 'cssImageUrl', obj.result.data[i].Thumbnail); if (userAgentData.hasIO === true) { const observer = new IntersectionObserver(setGridImage, {root: null, rootMargin: '0px'}); observer.observe(card); diff --git a/htdocs/js/viewsList.js b/htdocs/js/viewsList.js index ac210b0ee..934342c83 100644 --- a/htdocs/js/viewsList.js +++ b/htdocs/js/viewsList.js @@ -155,7 +155,6 @@ function updateList(obj, list, perCardCallback, createCardBodyCallback, createCa row.appendChild( elCreateEmpty('div', {"class": ["col", "list-image"]}) ); - setData(card, 'cssImageUrl', obj.result.data[i].Thumbnail); if (userAgentData.hasIO === true) { const observer = new IntersectionObserver(setListImage, {root: null, rootMargin: '0px'}); observer.observe(card);