diff --git a/mopidy_musicbox_webclient/static/js/controls.js b/mopidy_musicbox_webclient/static/js/controls.js index 1eb60855..32d48061 100644 --- a/mopidy_musicbox_webclient/static/js/controls.js +++ b/mopidy_musicbox_webclient/static/js/controls.js @@ -352,24 +352,25 @@ $('#popupShowInfo #album-cell').text('(Not available)') } var artistNames = '' - if (track.artists && track.artists.length > 0) { - for (var i = 0; i < track.artists.length; i++) { + if (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 } } - // 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++) { + // Fallback to track artists. + if (artistNames.length === 0 && 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 } } + if (artistNames.length > 0) { $('#popupShowInfo #artist-cell').text(artistNames) $('#popupShowInfo #artist-row').show() @@ -382,7 +383,7 @@ } else { $('#popupShowInfo #track-no-row').hide() } - if (track.duration) { + if (track.length) { var duration = new Date(track.length) $('#popupShowInfo #length-cell').text(duration.getUTCMinutes() + ':' + duration.getUTCSeconds()) $('#popupShowInfo #length-row').show()