get_images for local directories, fixes #497
This commit is contained in:
@ -80788,6 +80788,30 @@ var MopidyMiddleware = function () {
|
||||
}
|
||||
}
|
||||
|
||||
if (subdirectories.length > 0) {
|
||||
request(socket, store, 'library.getImages', { uris: helpers.arrayOf('uri', subdirectories) }).then(function (response) {
|
||||
|
||||
var subdirectories_with_images = subdirectories.map(function (subdir) {
|
||||
var images = response[subdir.uri] || undefined;
|
||||
if (images) {
|
||||
images = helpers.formatImages(helpers.digestMopidyImages(store.getState().mopidy, images));
|
||||
}
|
||||
return _extends({}, subdir, {
|
||||
images: images
|
||||
});
|
||||
});
|
||||
|
||||
console.log(subdirectories_with_images);
|
||||
|
||||
store.dispatch({
|
||||
type: 'MOPIDY_DIRECTORY_LOADED',
|
||||
directory: {
|
||||
subdirectories: subdirectories_with_images
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (tracks_uris.length > 0) {
|
||||
request(socket, store, 'library.lookup', { uris: tracks_uris }).then(function (response) {
|
||||
if (response.length <= 0) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -100,7 +100,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1581968126";
|
||||
var build = "1581969189";
|
||||
var version = "3.44.3";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
@ -2358,6 +2358,32 @@ const MopidyMiddleware = (function () {
|
||||
}
|
||||
}
|
||||
|
||||
if (subdirectories.length > 0) {
|
||||
request(socket, store, 'library.getImages', { uris: helpers.arrayOf('uri', subdirectories) })
|
||||
.then((response) => {
|
||||
|
||||
const subdirectories_with_images = subdirectories.map((subdir) => {
|
||||
let images = response[subdir.uri] || undefined;
|
||||
if (images) {
|
||||
images = helpers.formatImages(helpers.digestMopidyImages(store.getState().mopidy, images));
|
||||
}
|
||||
return {
|
||||
...subdir,
|
||||
images: images,
|
||||
}
|
||||
});
|
||||
|
||||
console.log(subdirectories_with_images);
|
||||
|
||||
store.dispatch({
|
||||
type: 'MOPIDY_DIRECTORY_LOADED',
|
||||
directory: {
|
||||
subdirectories: subdirectories_with_images,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (tracks_uris.length > 0) {
|
||||
request(socket, store, 'library.lookup', { uris: tracks_uris })
|
||||
.then((response) => {
|
||||
|
||||
Reference in New Issue
Block a user