Library albums release date and track count (fixes #30)

This commit is contained in:
James Barnsley
2017-01-19 09:11:31 +13:00
parent b611970907
commit 97ada1ed15
3 changed files with 11 additions and 6 deletions

View File

@ -244,8 +244,8 @@ const SpotifyMiddleware = (function(){
{
added_at: action.data.items[i].added_at,
tracks: action.data.items[i].album.tracks.items,
tracks_next: action.data.items[i].album.tracks.tracks_next,
tracks_total: action.data.items[i].album.tracks.tracks_total
tracks_more: action.data.items[i].album.tracks.next,
tracks_total: action.data.items[i].album.tracks.total
}
)
)

View File

@ -146,7 +146,7 @@ export default function reducer(ui = {}, action){
for (var i = 0; i < action.albums.length; i++){
var album = action.albums[i]
if (typeof(albums[album.uri]) !== 'undefined'){
if (albums[album.uri]){
artist = Object.assign({}, albums[album.uri], album)
}
albums[album.uri] = album

View File

@ -38,12 +38,12 @@ class LibraryAlbums extends React.Component{
if( this.props.view == 'list' ){
var columns = [
{
width: 35,
width: 30,
label: 'Name',
name: 'name'
},
{
width: 35,
width: 30,
label: 'Artists',
name: 'artists'
},
@ -54,8 +54,13 @@ class LibraryAlbums extends React.Component{
},
{
width: 15,
label: 'Released',
name: 'release_date'
},
{
width: 10,
label: 'Tracks',
name: 'tracks.total'
name: 'tracks_total'
}
]
return (