Notify when starting radio

This commit is contained in:
James Barnsley
2017-01-05 13:49:38 +13:00
parent 2ee811b0c8
commit c33c98085f
3 changed files with 32 additions and 36 deletions

View File

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

View File

@ -84,7 +84,7 @@ export default class Parallax extends React.Component{
if( this._loaded ){
this.setState(
{ scrollTop: window.scrollY },
this.updateCanvas( this.state.image )
this.updateCanvas( this.state.image )
)
}
}
@ -150,43 +150,10 @@ export default class Parallax extends React.Component{
image.y = ( ( this.state.canvas.height / 2 ) - ( image.height / 2 ) ) + ( ( percent / 100 ) * 100);
// actually draw the image on the canvas
context.drawImage(image.object, image.x, image.y, image.width, image.height);
context.drawImage(image.object, image.x, image.y, image.width, image.height)
// now update our component
self.setState({ image: image });
// poll for scroll changes
/*
var animateInterval = $interval(
function(){
window.requestAnimationFrame(function( event ){
var bannerPanel = $(document).find('.intro');
// if we've scrolled or resized
if(
state.scrollTop != $(document).scrollTop() ||
state.windowWidth != $(window).width() ||
state.windowHeight != $(window).height() ){
// update our state
state.scrollTop = $(document).scrollTop();
state.windowWidth = $(window).width();
state.windowHeight = $(window).height();
var bannerHeight = bannerPanel.outerHeight();
// and if we're within the bounds of our document
// this helps prevent us animating when the objects in question are off-screen
if( state.scrollTop < bannerHeight ){
positionArtistBackground( image );
}
}
});
},
10
);*/
}
render(){

View File

@ -168,6 +168,20 @@ const PusherMiddleware = (function(){
case 'PUSHER_START_RADIO':
store.dispatch({
type: 'PUSHER_SEND_BROADCAST',
action: 'broadcast',
ignore_self: true,
data: {
type: 'notification',
data: {
title: 'Radio started',
body: ' started radio mode',
icon: ''
}
}
})
var data = {
action: 'start_radio',
seed_artists: [],
@ -190,6 +204,21 @@ const PusherMiddleware = (function(){
break
case 'PUSHER_STOP_RADIO':
store.dispatch({
type: 'PUSHER_SEND_BROADCAST',
action: 'broadcast',
ignore_self: true,
data: {
type: 'notification',
data: {
title: 'Radio stopped',
body: ' stopped radio mode',
icon: ''
}
}
})
store.dispatch( uiActions.createNotification('Stopping radio') )
var data = {
action: 'stop_radio',