Collating album object before sorting, fixes #379
This commit is contained in:
@ -37,8 +37,7 @@ class AlbumGrid extends React.Component{
|
||||
return (
|
||||
<div className={className}>
|
||||
{
|
||||
this.props.albums.map(item => {
|
||||
var album = helpers.collate(item, {artists: this.props.artists});
|
||||
this.props.albums.map(album => {
|
||||
return (
|
||||
<GridItem
|
||||
key={album.uri}
|
||||
|
||||
@ -147,7 +147,7 @@ class LibraryAlbums extends React.Component{
|
||||
}
|
||||
|
||||
renderView(){
|
||||
var albums = []
|
||||
var albums = [];
|
||||
|
||||
// Spotify library items
|
||||
if (this.props.spotify_library_albums && (this.props.source == 'all' || this.props.source == 'spotify')){
|
||||
@ -197,6 +197,11 @@ class LibraryAlbums extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
// Collate each album into it's full object (including nested artists)
|
||||
for (let i = 0; i < albums.length; i++) {
|
||||
albums[i] = helpers.collate(albums[i], {artists: this.props.artists});
|
||||
}
|
||||
|
||||
if (this.props.sort){
|
||||
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse);
|
||||
}
|
||||
@ -355,6 +360,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
mopidy_connected: state.mopidy.connected,
|
||||
mopidy_uri_schemes: state.mopidy.uri_schemes,
|
||||
load_queue: state.ui.load_queue,
|
||||
artists: state.core.artists,
|
||||
albums: state.core.albums,
|
||||
mopidy_library_albums: state.mopidy.library_albums,
|
||||
mopidy_library_albums_status: (state.ui.processes.MOPIDY_LIBRARY_ALBUMS_PROCESSOR !== undefined ? state.ui.processes.MOPIDY_LIBRARY_ALBUMS_PROCESSOR.status : null),
|
||||
|
||||
Reference in New Issue
Block a user