diff --git a/mopidy_musicbox_webclient/static/js/library.js b/mopidy_musicbox_webclient/static/js/library.js index f399ba4..4ff0caf 100644 --- a/mopidy_musicbox_webclient/static/js/library.js +++ b/mopidy_musicbox_webclient/static/js/library.js @@ -267,7 +267,7 @@ function showArtist(nwuri) { $('#h_artistname').html(''); showLoading(true); mopidy.library.lookup({'uris': [nwuri]}).then(function(resultDict) { - var resultArr = resultDict[Object.keys(resultDict)[0]]; + var resultArr = resultDict[nwuri]; resultArr.uri = nwuri; processArtistResults(resultArr); }, console.error); @@ -293,7 +293,7 @@ function showAlbum(uri) { $('#coverpopupartist').html(artistname); showLoading(false); mopidy.library.lookup({'uris': [uri]}).then(function(resultDict) { - var resultArr = resultDict[Object.keys(resultDict)[0]]; + var resultArr = resultDict[uri]; resultArr.uri = uri; processAlbumResults(resultArr); }, console.error); @@ -302,7 +302,7 @@ function showAlbum(uri) { $('#h_albumname').html(''); $('#h_albumartist').html(''); mopidy.library.lookup({'uris': [uri]}).then(function(resultDict) { - var resultArr = resultDict[Object.keys(resultDict)[0]]; + var resultArr = resultDict[uri]; resultArr.uri = uri; processAlbumResults(resultArr); }, console.error); diff --git a/mopidy_musicbox_webclient/static/js/process_ws.js b/mopidy_musicbox_webclient/static/js/process_ws.js index 2479df2..ef6ec6a 100644 --- a/mopidy_musicbox_webclient/static/js/process_ws.js +++ b/mopidy_musicbox_webclient/static/js/process_ws.js @@ -119,9 +119,9 @@ function processBrowseDir(resultArr) { if (resultArr[i].type == 'track') { //console.log(resultArr[i]); mopidy.library.lookup({'uris': [resultArr[i].uri]}).then(function (resultDict) { - var uri = Object.keys(resultDict)[0]; - popupData[uri] = resultDict[uri][0]; - browseTracks.push(resultDict[uri][0]); + var lookup_uri = Object.keys(resultDict)[0]; + popupData[lookup_uri] = resultDict[lookup_uri][0]; + browseTracks.push(resultDict[lookup_uri][0]); }, console.error); child += '