[web] Lint source code
This commit is contained in:
parent
978e344ce2
commit
bab6146345
|
@ -35,7 +35,6 @@ export default [
|
||||||
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'none' }],
|
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'none' }],
|
||||||
'no-useless-assignment': 'off',
|
'no-useless-assignment': 'off',
|
||||||
'one-var': 'off',
|
'one-var': 'off',
|
||||||
'prefer-destructuring': 'off',
|
|
||||||
'prefer-named-capture-group': 'off',
|
'prefer-named-capture-group': 'off',
|
||||||
'sort-keys': 'off',
|
'sort-keys': 'off',
|
||||||
'vue/html-self-closing': 'off',
|
'vue/html-self-closing': 'off',
|
||||||
|
|
|
@ -144,19 +144,15 @@ export default {
|
||||||
protocol = 'wss://'
|
protocol = 'wss://'
|
||||||
}
|
}
|
||||||
|
|
||||||
let wsUrl = `${protocol + window.location.hostname}:${
|
let wsUrl = `${protocol}${window.location.hostname}:${this.$store.state.config.websocket_port}`
|
||||||
this.$store.state.config.websocket_port
|
|
||||||
}`
|
|
||||||
|
|
||||||
if (import.meta.env.DEV && import.meta.env.VITE_OWNTONE_URL) {
|
if (import.meta.env.DEV && import.meta.env.VITE_OWNTONE_URL) {
|
||||||
/*
|
/*
|
||||||
* If we are running in development mode, construct the websocket
|
* If we are running in development mode, construct the websocket
|
||||||
* url from the host of the environment variable VITE_OWNTONE_URL
|
* url from the host of the environment variable VITE_OWNTONE_URL
|
||||||
*/
|
*/
|
||||||
const owntoneUrl = new URL(import.meta.env.VITE_OWNTONE_URL)
|
const url = new URL(import.meta.env.VITE_OWNTONE_URL)
|
||||||
wsUrl = `${protocol + owntoneUrl.hostname}:${
|
wsUrl = `${protocol}${url.hostname}:${this.$store.state.config.websocket_port}`
|
||||||
this.$store.state.config.websocket_port
|
|
||||||
}`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const socket = new ReconnectingWebSocket(wsUrl, 'notify', {
|
const socket = new ReconnectingWebSocket(wsUrl, 'notify', {
|
||||||
|
|
|
@ -71,11 +71,11 @@ const dataObject = {
|
||||||
},
|
},
|
||||||
|
|
||||||
set(vm, response) {
|
set(vm, response) {
|
||||||
vm.artist = response[0]
|
vm.artist = response.shift()
|
||||||
vm.albums = []
|
vm.albums = []
|
||||||
vm.total = 0
|
vm.total = 0
|
||||||
vm.offset = 0
|
vm.offset = 0
|
||||||
vm.append_albums(response[1])
|
vm.append_albums(response.shift())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ const dataObject = {
|
||||||
},
|
},
|
||||||
|
|
||||||
set(vm, response) {
|
set(vm, response) {
|
||||||
vm.genre = response[0].data.genres.items[0]
|
vm.genre = response[0].data.genres.items.shift()
|
||||||
vm.albums = new GroupedList(response[1].data.albums, {
|
vm.albums = new GroupedList(response[1].data.albums, {
|
||||||
index: { field: 'name_sort', type: String }
|
index: { field: 'name_sort', type: String }
|
||||||
})
|
})
|
||||||
|
|
|
@ -73,7 +73,7 @@ const dataObject = {
|
||||||
},
|
},
|
||||||
|
|
||||||
set(vm, response) {
|
set(vm, response) {
|
||||||
vm.genre = response[0].data.genres.items[0]
|
vm.genre = response[0].data.genres.items.shift()
|
||||||
vm.tracks_list = new GroupedList(response[1].data.tracks)
|
vm.tracks_list = new GroupedList(response[1].data.tracks)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,11 +72,11 @@ const dataObject = {
|
||||||
},
|
},
|
||||||
|
|
||||||
set(vm, response) {
|
set(vm, response) {
|
||||||
vm.playlist = response[0]
|
vm.playlist = response.shift()
|
||||||
vm.tracks = []
|
vm.tracks = []
|
||||||
vm.total = 0
|
vm.total = 0
|
||||||
vm.offset = 0
|
vm.offset = 0
|
||||||
vm.append_tracks(response[1])
|
vm.append_tracks(response.shift())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue