Correctly pulling album name as title for directory (if directory.album.name)
This commit is contained in:
@ -1611,10 +1611,25 @@ const MopidyMiddleware = (function () {
|
|||||||
if (uri) {
|
if (uri) {
|
||||||
request(store, 'library.lookup', { uris: [uri] })
|
request(store, 'library.lookup', { uris: [uri] })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (!response[uri] || !response[uri].length) return;
|
const {
|
||||||
|
[uri]: results = [],
|
||||||
|
} = response;
|
||||||
|
|
||||||
|
if (!results.length) return;
|
||||||
|
|
||||||
|
let result = results[0];
|
||||||
|
if (result.album) {
|
||||||
|
result = {
|
||||||
|
...result,
|
||||||
|
name: result.album.name,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
type: 'MOPIDY_DIRECTORY_LOADED',
|
type: 'MOPIDY_DIRECTORY_LOADED',
|
||||||
directory: formatSimpleObject(response[uri][0]),
|
directory: {
|
||||||
|
...formatSimpleObject(result),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user