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) {
|
async function fillArt(parent, filter) {
|
||||||
let artist = filter["Artist"];
|
let artist = filter["AlbumArtist"];
|
||||||
let album = filter["Album"];
|
let album = filter["Album"];
|
||||||
let src = null;
|
let src = null;
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,9 @@ function buildHeader(filter) {
|
||||||
search.reset();
|
search.reset();
|
||||||
header.appendChild(search.getNode());
|
header.appendChild(search.getNode());
|
||||||
|
|
||||||
let artist = filter["Artist"];
|
let artist = filter["AlbumArtist"];
|
||||||
if (artist) {
|
if (artist) {
|
||||||
let artistFilter = {"Artist":artist};
|
let artistFilter = {"AlbumArtist":artist};
|
||||||
let button = html.button({icon:"artist"}, artist, header);
|
let button = html.button({icon:"artist"}, artist, header);
|
||||||
button.addEventListener("click", e => listAlbums(artistFilter));
|
button.addEventListener("click", e => listAlbums(artistFilter));
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function buildAlbum(album, filter, parent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildArtist(artist, 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);
|
let node = ui.group(ui.CTX_LIBRARY, artist, childFilter, parent);
|
||||||
node.addEventListener("click", e => listAlbums(childFilter));
|
node.addEventListener("click", e => listAlbums(childFilter));
|
||||||
node.dataset.name = artist;
|
node.dataset.name = artist;
|
||||||
|
@ -87,7 +87,7 @@ async function listAlbums(filter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function listArtists(filter) {
|
async function listArtists(filter) {
|
||||||
let artists = await mpd.listTags("Artist", filter);
|
let artists = await mpd.listTags("AlbumArtist", filter);
|
||||||
buildArtists(artists, filter);
|
buildArtists(artists, filter);
|
||||||
buildHeader(filter);
|
buildHeader(filter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,9 +61,11 @@ function sync(data) {
|
||||||
pubsub.publish("song-change", null, 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);
|
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) {
|
if (src) {
|
||||||
html.node("img", {src}, "", DOM.art);
|
html.node("img", {src}, "", DOM.art);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue