Playlists stored in universal store, indexes stored for each view
This commit is contained in:
@ -33,9 +33,16 @@ class LibraryPlaylists extends React.Component{
|
||||
}
|
||||
|
||||
renderView(){
|
||||
if( !this.props.playlists ) return null
|
||||
if( !this.props.library_playlists || !this.props.playlists ) return null
|
||||
|
||||
var playlists = []
|
||||
for (var i = 0; i < this.props.library_playlists.length; i++){
|
||||
var uri = this.props.library_playlists[i]
|
||||
if (this.props.playlists.hasOwnProperty(uri)){
|
||||
playlists.push(this.props.playlists[uri])
|
||||
}
|
||||
}
|
||||
|
||||
var playlists = Object.assign([], this.props.playlists)
|
||||
if( this.props.sort ){
|
||||
playlists = helpers.sortItems(playlists, this.props.sort, this.props.sort_reverse)
|
||||
}
|
||||
@ -141,6 +148,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
view: state.ui.library_playlists_view,
|
||||
sort: state.ui.library_playlists_sort,
|
||||
sort_reverse: state.ui.library_playlists_sort_reverse,
|
||||
library_playlists: state.ui.library_playlists,
|
||||
playlists: state.ui.playlists
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user