Searching as provider-based processes

This commit is contained in:
James Barnsley
2017-09-04 21:04:11 +12:00
parent dc15e6bed0
commit 3fdef74dc0
4 changed files with 203 additions and 136 deletions

View File

@ -36,7 +36,7 @@ class Search extends React.Component{
this.props.mopidyActions.getSearchResults(this.props.view, this.props.params.query)
}
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes && this.props.search_settings.uri_schemes.includes('spotify')){
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes && this.props.search_settings.uri_schemes.includes('spotify:')){
this.props.spotifyActions.getSearchResults(this.props.view, this.props.params.query)
}
}
@ -46,9 +46,21 @@ class Search extends React.Component{
this.props.mopidyActions.getSearchResults(newProps.view, newProps.params.query)
}
if (!this.props.spotify_connected && newProps.spotify_connected && newProps.search_settings.uri_schemes.includes('spotify')){
if (!this.props.spotify_connected && newProps.spotify_connected && newProps.search_settings.uri_schemes.includes('spotify:')){
this.props.spotifyActions.getSearchResults(newProps.view, newProps.params.query)
}
// Search changed
if (this.props.params.query !== newProps.params.query || this.props.view !== newProps.view){
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes){
this.props.mopidyActions.getSearchResults(newProps.view, newProps.params.query)
}
if (this.props.mopidy_connected && this.props.search_settings.uri_schemes && this.props.search_settings.uri_schemes.includes('spotify:')){
this.props.spotifyActions.getSearchResults(newProps.view, newProps.params.query)
}
}
}
loadMore(type){