Refactor URI lookup routines.
This commit is contained in:
parent
4992d038a9
commit
4ec547a66a
@ -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);
|
||||
|
||||
@ -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 += '<li class="song albumli" id="browselisttracks-' + resultArr[i].uri + '">' +
|
||||
'<a href="#" class="moreBtn" onclick="return popupTracks(event, \'' + uri + '\', \'' + resultArr[i].uri + '\', \'' + index + '\');">' +
|
||||
@ -140,8 +140,8 @@ function processBrowseDir(resultArr) {
|
||||
|
||||
$('#browselist').html(child);
|
||||
if (browseStack.length > 0 ) {
|
||||
child = getMediaHuman(resultArr[0].uri);
|
||||
iconClass = getMediaClass(resultArr[0].uri);
|
||||
child = getMediaHuman(uri);
|
||||
iconClass = getMediaClass(uri);
|
||||
$('#browsepath').html('<i class="' + iconClass + '"></i> ' + child);
|
||||
} else {
|
||||
$('#browsepath').html('');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
CACHE MANIFEST
|
||||
|
||||
# 2016-01-31:v1
|
||||
# 2016-01-31:v2
|
||||
|
||||
NETWORK:
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user