Use track artist before falling back to album artist.
This commit is contained in:
parent
4f9e370a45
commit
dfffcbf176
21
mopidy_musicbox_webclient/static/js/controls.js
vendored
21
mopidy_musicbox_webclient/static/js/controls.js
vendored
@ -352,17 +352,7 @@
|
|||||||
$('#popupShowInfo #album-cell').text('(Not available)')
|
$('#popupShowInfo #album-cell').text('(Not available)')
|
||||||
}
|
}
|
||||||
var artistNames = ''
|
var artistNames = ''
|
||||||
if (track.album.artists && track.album.artists.length > 0) {
|
if (track.artists && track.artists.length > 0) {
|
||||||
for (i = 0; i < track.album.artists.length; i++) {
|
|
||||||
if (i > 0) {
|
|
||||||
artistNames = artistNames + ', '
|
|
||||||
}
|
|
||||||
artistNames = artistNames + track.album.artists[i].name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback to track artists.
|
|
||||||
if (artistNames.length === 0 && track.artists && track.artists.length > 0) {
|
|
||||||
for (var i = 0; i < track.artists.length; i++) {
|
for (var i = 0; i < track.artists.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
artistNames = artistNames + ', '
|
artistNames = artistNames + ', '
|
||||||
@ -371,6 +361,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback to album artists.
|
||||||
|
if (artistNames.length === 0 && track.album.artists && track.album.artists.length > 0) {
|
||||||
|
for (i = 0; i < track.album.artists.length; i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
artistNames = artistNames + ', '
|
||||||
|
}
|
||||||
|
artistNames = artistNames + track.album.artists[i].name
|
||||||
|
}
|
||||||
|
}
|
||||||
if (artistNames.length > 0) {
|
if (artistNames.length > 0) {
|
||||||
$('#popupShowInfo #artist-cell').text(artistNames)
|
$('#popupShowInfo #artist-cell').text(artistNames)
|
||||||
$('#popupShowInfo #artist-row').show()
|
$('#popupShowInfo #artist-row').show()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user