Window title track

This commit is contained in:
James Barnsley
2017-10-30 11:59:45 +13:00
parent f6c00394c8
commit 31f2b736cc
3 changed files with 25 additions and 10 deletions

View File

@ -272,7 +272,7 @@ const CoreMiddleware = (function(){
case 'MOPIDY_CURRENTTLTRACK':
if (action.data && action.data.track){
helpers.setWindowTitle(action.data.track, store.getState().mopidy.play_state)
helpers.setWindowTitle(action.data.track, store.getState().mopidy.play_state);
// make sure our images use mopidy host:port
if (action.data.track.album && action.data.track.album.images && action.data.track.album.images.length > 0){

View File

@ -15,8 +15,17 @@ const UIMiddleware = (function(){
switch(action.type){
case 'MOPIDY_STATE':
helpers.setWindowTitle(store.getState().core.current_track, action.data)
next(action)
// Get the current track from our index
var tracks = store.getState().core.tracks;
var current_track_uri = store.getState().core.current_track;
var current_track = null;
if (tracks[current_track_uri] !== undefined){
current_track = tracks[current_track_uri];
}
helpers.setWindowTitle(current_track, action.data);
next(action);
break
case 'OPEN_MODAL':