Editing and adding to playlists, then we'll reload it

This commit is contained in:
James Barnsley
2017-02-03 09:04:47 +13:00
parent 808ce2d18c
commit 058d2607e9
8 changed files with 45 additions and 22 deletions

View File

@ -327,6 +327,7 @@ const MopidyMiddleware = (function(){
type: 'playlist',
name: response.name,
uri: response.uri,
source: 'local',
last_modified: response.last_modified,
can_edit: (response.uri.startsWith('m3u:')),
tracks_total: ( response.tracks ? response.tracks.length : 0 )
@ -344,7 +345,6 @@ const MopidyMiddleware = (function(){
break;
case 'MOPIDY_GET_PLAYLIST':
store.dispatch({ type: 'MOPIDY_PLAYLIST_LOADED', data: false });
instruct( socket, store, 'playlists.lookup', action.data )
.then( response => {
var playlist = Object.assign(
@ -352,8 +352,8 @@ const MopidyMiddleware = (function(){
response,
{
type: 'playlist',
tracks: ( response.tracks ? response.tracks : null ),
tracks_total: ( response.tracks ? response.tracks.length : null )
tracks: ( response.tracks ? response.tracks : [] ),
tracks_total: ( response.tracks ? response.tracks.length : [] )
}
)