Locale for all categories; Upgrader

This commit is contained in:
James Barnsley
2017-01-10 14:12:54 +13:00
parent db8c0d657a
commit 15a9da0369
6 changed files with 16 additions and 11 deletions

View File

@ -8,7 +8,7 @@ from frontend import IrisFrontend
from http import RequestHandler
logger = logging.getLogger(__name__)
__version__ = '2.10.14'
__version__ = '2.10.13'
##
# Core extension class

View File

@ -30,7 +30,7 @@ class VersionManager extends React.Component{
}
if( this.props.pusher.version.upgrade_available ){
return <button className="secondary" onClick={() => this.props.pusherActions.performUpgrade()}>Upgrade to { this.props.pusher.version.latest }</button>
return <button className="secondary" onClick={() => this.props.pusherActions.startUpgrade()}>Upgrade to { this.props.pusher.version.latest }</button>
}
return <button className="secondary" disabled>Already up to date</button>

View File

@ -29,15 +29,15 @@ export function disconnect(){
}
}
export function performUpgrade(){
export function startUpgrade(){
return {
type: 'PUSHER_UPGRADING'
type: 'START_UPGRADE'
}
}
export function getConnections(){
return {
type: 'PUSHER_GET_CONNECTIONS'
type: 'GET_CONNECTIONS'
}
}

View File

@ -126,11 +126,16 @@ const PusherMiddleware = (function(){
return next(action);
break;
case 'UPGRADING':
case 'START_UPGRADE':
request({ action: 'perform_upgrade' })
.then(
response => {
store.dispatch({ type: 'UPGRADE', data: response.data })
response => {
if (response.data.version.upgrade_successful){
uiActions.createNotification('Upgrade complete')
}else{
uiActions.createNotification('Upgrade failed, manual upgrade required')
}
store.dispatch({ type: 'VERSION', data: response.data })
}
)
return next(action);

View File

@ -43,7 +43,7 @@ export default function reducer(pusher = {}, action){
upgrading: false
});
case 'UPGRADING':
case 'START_UPGRADE':
return Object.assign({}, pusher, { upgrading: true });
default:

View File

@ -254,7 +254,7 @@ export function getFeaturedPlaylists(){
var timestamp = year+'-'+month+'-'+day+'T'+hour+':'+min+':'+sec;
sendRequest( dispatch, getState, 'browse/featured-playlists?timestamp='+timestamp+'&country='+getState().spotify.country+'&limit=50' )
sendRequest( dispatch, getState, 'browse/featured-playlists?timestamp='+timestamp+'&country='+getState().spotify.country+'&limit=50&locale='+getState().spotify.locale )
.then( response => {
dispatch({
type: 'SPOTIFY_FEATURED_PLAYLISTS_LOADED',
@ -284,7 +284,7 @@ export function getCategory( id ){
dispatch({ type: 'SPOTIFY_CATEGORY_LOADED', data: false });
sendRequest( dispatch, getState, 'browse/categories/'+id )
sendRequest( dispatch, getState, 'browse/categories/'+id+'?country='+getState().spotify.country+'&locale='+getState().spotify.locale )
.then( response => {
dispatch({
type: 'SPOTIFY_CATEGORY_LOADED',