Auto eslint fix

This commit is contained in:
James Barnsley
2019-09-05 15:36:11 +12:00
parent 4513a0d109
commit e4d53a2d35
126 changed files with 23283 additions and 23573 deletions

View File

@ -1,6 +1,7 @@
import { createStore, applyMiddleware, combineReducers } from 'redux';
import thunk from 'redux-thunk';
import * as helpers from '../helpers';
import core from '../services/core/reducer';
@ -15,7 +16,6 @@ import genius from '../services/genius/reducer';
import migration from './migration';
import thunk from 'redux-thunk';
import coreMiddleware from '../services/core/middleware';
import uiMiddleware from '../services/ui/middleware';
import pusherMiddleware from '../services/pusher/middleware';
@ -28,121 +28,121 @@ import snapcastMiddleware from '../services/snapcast/middleware';
import localstorageMiddleware from '../services/localstorage/middleware';
let state = {
core: {
outputs: [],
queue: [],
queue_metadata: {},
current_track: null,
albums: {},
artists: {},
playlists: {},
users: {},
tracks: {},
http_streaming_enabled: false,
http_streaming_cachebuster: null,
http_streaming_url: "http://"+window.location.hostname+":8000/mopidy"
},
ui: {
theme: 'dark',
smooth_scrolling_enabled: true,
hotkeys_enabled: true,
playback_controls_touch_enabled: true,
allow_reporting: true,
wide_scrollbar_enabled: false,
window_focus: true,
slim_mode: false,
selected_tracks: [],
notifications: {},
processes: {}
},
mopidy: {
connected: false,
host: window.location.hostname,
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
ssl: (window.location.protocol === 'https:' ? true : false),
mute: false,
volume: 0,
progress: 0,
play_state: null,
uri_schemes: [],
library_albums_uri: 'local:directory?type=album',
library_artists_uri: 'local:directory?type=artist'
},
pusher: {
connected: false,
username: helpers.generateGuid(),
client_id: helpers.generateGuid(),
connections: {},
version: {
current: null
},
config: {}
},
lastfm: {
me: null,
authorization_url: 'https://jamesbarnsley.co.nz/iris/auth_lastfm.php'
},
genius: {
me: null,
authorization_url: 'https://jamesbarnsley.co.nz/iris/auth_genius.php'
},
spotify: {
me: null,
autocomplete_results: {},
authorization_url: 'https://jamesbarnsley.co.nz/iris/auth_spotify.php'
},
google: {
enabled: false
},
snapcast: {
streams: {},
groups: {},
clients: {},
server: null,
commands: {}
}
core: {
outputs: [],
queue: [],
queue_metadata: {},
current_track: null,
albums: {},
artists: {},
playlists: {},
users: {},
tracks: {},
http_streaming_enabled: false,
http_streaming_cachebuster: null,
http_streaming_url: `http://${window.location.hostname}:8000/mopidy`,
},
ui: {
theme: 'dark',
smooth_scrolling_enabled: true,
hotkeys_enabled: true,
playback_controls_touch_enabled: true,
allow_reporting: true,
wide_scrollbar_enabled: false,
window_focus: true,
slim_mode: false,
selected_tracks: [],
notifications: {},
processes: {},
},
mopidy: {
connected: false,
host: window.location.hostname,
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
ssl: (window.location.protocol === 'https:'),
mute: false,
volume: 0,
progress: 0,
play_state: null,
uri_schemes: [],
library_albums_uri: 'local:directory?type=album',
library_artists_uri: 'local:directory?type=artist',
},
pusher: {
connected: false,
username: helpers.generateGuid(),
client_id: helpers.generateGuid(),
connections: {},
version: {
current: null,
},
config: {},
},
lastfm: {
me: null,
authorization_url: 'https://jamesbarnsley.co.nz/iris/auth_lastfm.php',
},
genius: {
me: null,
authorization_url: 'https://jamesbarnsley.co.nz/iris/auth_genius.php',
},
spotify: {
me: null,
autocomplete_results: {},
authorization_url: 'https://jamesbarnsley.co.nz/iris/auth_spotify.php',
},
google: {
enabled: false,
},
snapcast: {
streams: {},
groups: {},
clients: {},
server: null,
commands: {},
},
};
// load all our stored values from LocalStorage
state.core = Object.assign({}, state.core, helpers.getStorage('core'));
state.ui = Object.assign({}, state.ui, helpers.getStorage('ui'));
state.mopidy = Object.assign({}, state.mopidy, helpers.getStorage('mopidy'));
state.pusher = Object.assign({}, state.pusher, helpers.getStorage('pusher'));
state.spotify = Object.assign({}, state.spotify, helpers.getStorage('spotify'));
state.lastfm = Object.assign({}, state.lastfm, helpers.getStorage('lastfm'));
state.genius = Object.assign({}, state.genius, helpers.getStorage('genius'));
state.google = Object.assign({}, state.google, helpers.getStorage('google'));
state.snapcast = Object.assign({}, state.snapcast, helpers.getStorage('snapcast'));
state.core = { ...state.core, ...helpers.getStorage('core') };
state.ui = { ...state.ui, ...helpers.getStorage('ui') };
state.mopidy = { ...state.mopidy, ...helpers.getStorage('mopidy') };
state.pusher = { ...state.pusher, ...helpers.getStorage('pusher') };
state.spotify = { ...state.spotify, ...helpers.getStorage('spotify') };
state.lastfm = { ...state.lastfm, ...helpers.getStorage('lastfm') };
state.genius = { ...state.genius, ...helpers.getStorage('genius') };
state.google = { ...state.google, ...helpers.getStorage('google') };
state.snapcast = { ...state.snapcast, ...helpers.getStorage('snapcast') };
// Run any migrations
state = migration(state);
const reducers = combineReducers({
core,
ui,
pusher,
mopidy,
lastfm,
genius,
spotify,
google,
snapcast
core,
ui,
pusher,
mopidy,
lastfm,
genius,
spotify,
google,
snapcast,
});
export default createStore(
reducers,
state,
applyMiddleware(
thunk,
localstorageMiddleware,
coreMiddleware,
uiMiddleware,
mopidyMiddleware,
pusherMiddleware,
spotifyMiddleware,
lastfmMiddleware,
geniusMiddleware,
googleMiddleware,
snapcastMiddleware
)
reducers,
state,
applyMiddleware(
thunk,
localstorageMiddleware,
coreMiddleware,
uiMiddleware,
mopidyMiddleware,
pusherMiddleware,
spotifyMiddleware,
lastfmMiddleware,
geniusMiddleware,
googleMiddleware,
snapcastMiddleware,
),
);

View File

@ -1,7 +1,7 @@
export default state => {
if (state.ui.shortkeys_enabled !== undefined){
state.ui.hotkeys_enabled = state.ui.shortkeys_enabled;
}
return state;
}
export default (state) => {
if (state.ui.shortkeys_enabled !== undefined) {
state.ui.hotkeys_enabled = state.ui.shortkeys_enabled;
}
return state;
};