Refactor URI lookup routines.
This commit is contained in:
parent
4992d038a9
commit
4ec547a66a
@ -267,7 +267,7 @@ function showArtist(nwuri) {
|
|||||||
$('#h_artistname').html('');
|
$('#h_artistname').html('');
|
||||||
showLoading(true);
|
showLoading(true);
|
||||||
mopidy.library.lookup({'uris': [nwuri]}).then(function(resultDict) {
|
mopidy.library.lookup({'uris': [nwuri]}).then(function(resultDict) {
|
||||||
var resultArr = resultDict[Object.keys(resultDict)[0]];
|
var resultArr = resultDict[nwuri];
|
||||||
resultArr.uri = nwuri;
|
resultArr.uri = nwuri;
|
||||||
processArtistResults(resultArr);
|
processArtistResults(resultArr);
|
||||||
}, console.error);
|
}, console.error);
|
||||||
@ -293,7 +293,7 @@ function showAlbum(uri) {
|
|||||||
$('#coverpopupartist').html(artistname);
|
$('#coverpopupartist').html(artistname);
|
||||||
showLoading(false);
|
showLoading(false);
|
||||||
mopidy.library.lookup({'uris': [uri]}).then(function(resultDict) {
|
mopidy.library.lookup({'uris': [uri]}).then(function(resultDict) {
|
||||||
var resultArr = resultDict[Object.keys(resultDict)[0]];
|
var resultArr = resultDict[uri];
|
||||||
resultArr.uri = uri;
|
resultArr.uri = uri;
|
||||||
processAlbumResults(resultArr);
|
processAlbumResults(resultArr);
|
||||||
}, console.error);
|
}, console.error);
|
||||||
@ -302,7 +302,7 @@ function showAlbum(uri) {
|
|||||||
$('#h_albumname').html('');
|
$('#h_albumname').html('');
|
||||||
$('#h_albumartist').html('');
|
$('#h_albumartist').html('');
|
||||||
mopidy.library.lookup({'uris': [uri]}).then(function(resultDict) {
|
mopidy.library.lookup({'uris': [uri]}).then(function(resultDict) {
|
||||||
var resultArr = resultDict[Object.keys(resultDict)[0]];
|
var resultArr = resultDict[uri];
|
||||||
resultArr.uri = uri;
|
resultArr.uri = uri;
|
||||||
processAlbumResults(resultArr);
|
processAlbumResults(resultArr);
|
||||||
}, console.error);
|
}, console.error);
|
||||||
|
|||||||
@ -119,9 +119,9 @@ function processBrowseDir(resultArr) {
|
|||||||
if (resultArr[i].type == 'track') {
|
if (resultArr[i].type == 'track') {
|
||||||
//console.log(resultArr[i]);
|
//console.log(resultArr[i]);
|
||||||
mopidy.library.lookup({'uris': [resultArr[i].uri]}).then(function (resultDict) {
|
mopidy.library.lookup({'uris': [resultArr[i].uri]}).then(function (resultDict) {
|
||||||
var uri = Object.keys(resultDict)[0];
|
var lookup_uri = Object.keys(resultDict)[0];
|
||||||
popupData[uri] = resultDict[uri][0];
|
popupData[lookup_uri] = resultDict[lookup_uri][0];
|
||||||
browseTracks.push(resultDict[uri][0]);
|
browseTracks.push(resultDict[lookup_uri][0]);
|
||||||
}, console.error);
|
}, console.error);
|
||||||
child += '<li class="song albumli" id="browselisttracks-' + resultArr[i].uri + '">' +
|
child += '<li class="song albumli" id="browselisttracks-' + resultArr[i].uri + '">' +
|
||||||
'<a href="#" class="moreBtn" onclick="return popupTracks(event, \'' + uri + '\', \'' + resultArr[i].uri + '\', \'' + index + '\');">' +
|
'<a href="#" class="moreBtn" onclick="return popupTracks(event, \'' + uri + '\', \'' + resultArr[i].uri + '\', \'' + index + '\');">' +
|
||||||
@ -140,8 +140,8 @@ function processBrowseDir(resultArr) {
|
|||||||
|
|
||||||
$('#browselist').html(child);
|
$('#browselist').html(child);
|
||||||
if (browseStack.length > 0 ) {
|
if (browseStack.length > 0 ) {
|
||||||
child = getMediaHuman(resultArr[0].uri);
|
child = getMediaHuman(uri);
|
||||||
iconClass = getMediaClass(resultArr[0].uri);
|
iconClass = getMediaClass(uri);
|
||||||
$('#browsepath').html('<i class="' + iconClass + '"></i> ' + child);
|
$('#browsepath').html('<i class="' + iconClass + '"></i> ' + child);
|
||||||
} else {
|
} else {
|
||||||
$('#browsepath').html('');
|
$('#browsepath').html('');
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
CACHE MANIFEST
|
CACHE MANIFEST
|
||||||
|
|
||||||
# 2016-01-31:v1
|
# 2016-01-31:v2
|
||||||
|
|
||||||
NETWORK:
|
NETWORK:
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user