diff --git a/mopidy_musicbox_webclient/static/js/controls.js b/mopidy_musicbox_webclient/static/js/controls.js index 32d48061..d3790683 100644 --- a/mopidy_musicbox_webclient/static/js/controls.js +++ b/mopidy_musicbox_webclient/static/js/controls.js @@ -352,25 +352,24 @@ $('#popupShowInfo #album-cell').text('(Not available)') } var artistNames = '' - if (track.album.artists && track.album.artists.length > 0) { - for (i = 0; i < track.album.artists.length; i++) { + if (track.artists && track.artists.length > 0) { + for (var i = 0; i < track.artists.length; i++) { if (i > 0) { artistNames = artistNames + ', ' } - artistNames = artistNames + track.album.artists[i].name + artistNames = artistNames + track.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++) { + // 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.artists[i].name + artistNames = artistNames + track.album.artists[i].name } } - if (artistNames.length > 0) { $('#popupShowInfo #artist-cell').text(artistNames) $('#popupShowInfo #artist-row').show()