diff --git a/htdocs/css/mympd.css b/htdocs/css/mympd.css
index 174d588..0daa272 100644
--- a/htdocs/css/mympd.css
+++ b/htdocs/css/mympd.css
@@ -61,6 +61,7 @@ small {
.album-cover {
background-size: cover;
+ background-image: url("/assets/coverimage-loading.png");
border: 1px solid black;
border-radius: 5px;
overflow: hidden;
diff --git a/htdocs/js/mympd.js b/htdocs/js/mympd.js
index 035bf1a..0d58d73 100644
--- a/htdocs/js/mympd.js
+++ b/htdocs/js/mympd.js
@@ -1319,7 +1319,6 @@ function parseListDBtags(obj) {
card.classList.add('mr-0');
card.setAttribute('id', id);
card.setAttribute('data-album', encodeURI(obj.data[i].value));
- card.setAttribute('data-init', 'false');
card.innerHTML = '
' +
'
' +
'
' +
@@ -1399,11 +1398,9 @@ function createListTitleObserver(ele) {
function getListTitles(changes, observer) {
changes.forEach(change => {
if (change.intersectionRatio > 0) {
- if (change.target.getAttribute('data-init') == 'false') {
- change.target.setAttribute('data-init', 'true');
- var album = decodeURI(change.target.getAttribute('data-album'));
- sendAPI({"cmd": "MPD_API_DATABASE_TAG_ALBUM_TITLE_LIST", "data": { "album": album, "search": app.current.search, "tag": app.current.view}}, parseListTitles);
- }
+ observer.unobserve(change.target);
+ var album = decodeURI(change.target.getAttribute('data-album'));
+ sendAPI({"cmd": "MPD_API_DATABASE_TAG_ALBUM_TITLE_LIST", "data": { "album": album, "search": app.current.search, "tag": app.current.view}}, parseListTitles);
}
});
}