Replacing tracks with lookup results avoids working around https://github.com/tkem/mopidy-dleyna/issues/72

This commit is contained in:
James Barnsley
2021-02-16 21:11:59 +13:00
parent 1d1e1c2c97
commit 10c2f8a19f
5 changed files with 14 additions and 24 deletions

View File

@ -155384,21 +155384,20 @@ var MopidyMiddleware = function () {
});
if (trackUrisToLoad.length) {
console.info("Loading ".concat(trackUrisToLoad.length, " track URIs"));
request(store, 'library.lookup', {
uris: trackUrisToLoad
}).then(function (response) {
// Mash all our full tracks into the refs
var fullTrackObjects = tracks.map(function (track) {
var fullTrackResults = response[track.uri];
return _objectSpread(_objectSpread(_objectSpread({}, track), fullTrackResults && fullTrackResults.length > 0 ? Object(_util_format__WEBPACK_IMPORTED_MODULE_6__["formatTrack"])(fullTrackResults[0]) : {}), {}, {
loading: false
});
var fullTrackObjects = Object.values(response).map(function (t) {
return t.length > 0 ? Object(_util_format__WEBPACK_IMPORTED_MODULE_6__["formatTrack"])(t[0]) : undefined;
});
store.dispatch({
type: 'MOPIDY_DIRECTORY_LOADED',
directory: {
uri: uri,
tracks: fullTrackObjects
tracks: fullTrackObjects.filter(function (t) {
return t instanceof Object;
})
}
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -106,7 +106,7 @@
// Release details
// These are automatically injected to built HTML
var build = "1613412309";
var build = "1613463048";
var version = "3.55.5";
// Construct the script tag