s/artist/albumartist/ where appropriate
This commit is contained in:
parent
105819c509
commit
6fc62a2599
3 changed files with 9 additions and 7 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue