From 6fc62a2599ec75b9a97edcad69274cf0a7e7d15f Mon Sep 17 00:00:00 2001 From: Ondrej Zara Date: Sun, 21 Apr 2019 21:44:09 +0200 Subject: [PATCH] s/artist/albumartist/ where appropriate --- app/js/lib/ui.js | 2 +- app/js/library.js | 8 ++++---- app/js/player.js | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/js/lib/ui.js b/app/js/lib/ui.js index f89398f..a7d4539 100644 --- a/app/js/lib/ui.js +++ b/app/js/lib/ui.js @@ -25,7 +25,7 @@ async function enqueue(type, what) { } async function fillArt(parent, filter) { - let artist = filter["Artist"]; + let artist = filter["AlbumArtist"]; let album = filter["Album"]; let src = null; diff --git a/app/js/library.js b/app/js/library.js index a1d5679..848821f 100644 --- a/app/js/library.js +++ b/app/js/library.js @@ -17,9 +17,9 @@ function buildHeader(filter) { search.reset(); header.appendChild(search.getNode()); - let artist = filter["Artist"]; + let artist = filter["AlbumArtist"]; if (artist) { - let artistFilter = {"Artist":artist}; + let artistFilter = {"AlbumArtist":artist}; let button = html.button({icon:"artist"}, artist, header); button.addEventListener("click", e => listAlbums(artistFilter)); @@ -43,7 +43,7 @@ function buildAlbum(album, filter, parent) { } function buildArtist(artist, filter, parent) { - let childFilter = Object.assign({}, filter, {"Artist": artist}); + let childFilter = Object.assign({}, filter, {"AlbumArtist": artist}); let node = ui.group(ui.CTX_LIBRARY, artist, childFilter, parent); node.addEventListener("click", e => listAlbums(childFilter)); node.dataset.name = artist; @@ -87,7 +87,7 @@ async function listAlbums(filter) { } async function listArtists(filter) { - let artists = await mpd.listTags("Artist", filter); + let artists = await mpd.listTags("AlbumArtist", filter); buildArtists(artists, filter); buildHeader(filter); } diff --git a/app/js/player.js b/app/js/player.js index 6df23d6..22243e0 100644 --- a/app/js/player.js +++ b/app/js/player.js @@ -61,9 +61,11 @@ function sync(data) { pubsub.publish("song-change", null, data); } - if (data["Artist"] != current["Artist"] || data["Album"] != current["Album"]) { // changed album (art) + let artistNew = data["AlbumArtist"] || data["Artist"]; + let artistOld = current["AlbumArtist"] || current["Artist"]; + if (artistNew != artistOld || data["Album"] != current["Album"]) { // changed album (art) html.clear(DOM.art); - art.get(data["Artist"], data["Album"], data["file"]).then(src => { + art.get(artistNew, data["Album"], data["file"]).then(src => { if (src) { html.node("img", {src}, "", DOM.art); } else {