Missing origin uri when playing entire playlist
This commit is contained in:
@ -356,10 +356,10 @@ class ContextMenu extends React.Component{
|
||||
this.setState({submenu_expanded: expanded})
|
||||
|
||||
if (expanded){
|
||||
if (!this.props.spotify_library_playlists){
|
||||
if (!this.props.spotify_library_playlists_loaded_all){
|
||||
this.props.spotifyActions.getLibraryPlaylists()
|
||||
}
|
||||
if (!this.props.mopidy_library_playlists){
|
||||
if (!this.props.mopidy_library_playlists_loaded_all){
|
||||
this.props.mopidyActions.getLibraryPlaylists()
|
||||
}
|
||||
}
|
||||
@ -633,7 +633,9 @@ const mapStateToProps = (state, ownProps) => {
|
||||
current_track: state.core.current_track,
|
||||
current_tracklist: state.core.current_tracklist,
|
||||
spotify_library_playlists: state.spotify.library_playlists,
|
||||
spotify_library_playlists_loaded_all: state.spotify.library_playlists_loaded_all,
|
||||
mopidy_library_playlists: state.mopidy.library_playlists,
|
||||
mopidy_library_playlists_loaded_all: state.mopidy.library_playlists_loaded_all,
|
||||
spotify_library_artists: state.spotify.library_artists,
|
||||
mopidy_library_artists: state.mopidy.library_artists,
|
||||
spotify_library_albums: state.spotify.library_albums,
|
||||
|
||||
@ -313,7 +313,7 @@ const MopidyMiddleware = (function(){
|
||||
}
|
||||
})
|
||||
break
|
||||
|
||||
/*
|
||||
case 'SPOTIFY_ALL_PLAYLIST_TRACKS_LOADED_FOR_PLAYING':
|
||||
var uris = []
|
||||
for (var i = 0; i < action.tracks.length; i++){
|
||||
@ -321,6 +321,7 @@ const MopidyMiddleware = (function(){
|
||||
}
|
||||
store.dispatch(mopidyActions.playURIs(uris, action.uri))
|
||||
break
|
||||
*/
|
||||
|
||||
case 'MOPIDY_ENQUEUE_URIS':
|
||||
|
||||
@ -952,6 +953,7 @@ const MopidyMiddleware = (function(){
|
||||
}
|
||||
|
||||
store.dispatch({ type: 'MOPIDY_LIBRARY_PLAYLISTS_LOADED', uris: playlist_uris_filtered });
|
||||
store.dispatch({ type: 'MOPIDY_LIBRARY_PLAYLISTS_LOADED_ALL' });
|
||||
|
||||
// get the full playlist objects
|
||||
for (var i = 0; i < playlist_uris_filtered.length; i++ ){
|
||||
|
||||
@ -109,6 +109,9 @@ export default function reducer(mopidy = {}, action){
|
||||
}
|
||||
return Object.assign({}, mopidy, { library_playlists: helpers.removeDuplicates(uris) })
|
||||
|
||||
case 'MOPIDY_LIBRARY_PLAYLISTS_LOADED_ALL':
|
||||
return Object.assign({}, mopidy, { library_playlists_loaded_all: true })
|
||||
|
||||
case 'MOPIDY_LIBRARY_PLAYLIST_CREATED':
|
||||
var library_playlists = []
|
||||
if (mopidy.library_playlists){
|
||||
|
||||
@ -1243,6 +1243,7 @@ export function getPlaylistTracksForPlaying(uri){
|
||||
'SPOTIFY_GET_PLAYLIST_TRACKS_FOR_PLAYING_PROCESSOR',
|
||||
'Loading playlist tracks',
|
||||
{
|
||||
uri: uri,
|
||||
next: 'users/'+ helpers.getFromUri('userid',uri) +'/playlists/'+ helpers.getFromUri('playlistid',uri) +'/tracks?market='+getState().core.country
|
||||
}
|
||||
))
|
||||
@ -1295,7 +1296,7 @@ export function getPlaylistTracksForPlayingProcessor(data){
|
||||
}
|
||||
))
|
||||
} else {
|
||||
dispatch(mopidyActions.playURIs(uris))
|
||||
dispatch(mopidyActions.playURIs(uris, data.uri))
|
||||
dispatch(uiActions.processFinished('SPOTIFY_GET_PLAYLIST_TRACKS_FOR_PLAYING_PROCESSOR'))
|
||||
}
|
||||
});
|
||||
@ -1425,6 +1426,7 @@ export function getLibraryPlaylistsProcessor(data){
|
||||
dispatch(uiActions.runProcess('SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR', {next: response.next}))
|
||||
} else {
|
||||
dispatch(uiActions.processFinished('SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR'))
|
||||
dispatch({type: 'SPOTIFY_LIBRARY_PLAYLISTS_LOADED_ALL'})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -200,6 +200,9 @@ export default function reducer(spotify = {}, action){
|
||||
})
|
||||
|
||||
|
||||
case 'SPOTIFY_LIBRARY_PLAYLISTS_LOADED_ALL':
|
||||
return Object.assign({}, spotify, { library_playlists_loaded_all: true })
|
||||
|
||||
case 'SPOTIFY_LIBRARY_PLAYLISTS_CLEAR':
|
||||
return Object.assign({}, spotify, { library_playlists: [] })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user