[web] Remove unused parameters

This commit is contained in:
Alain Nussbaumer 2025-04-26 08:20:17 +02:00
parent 40c658cb8b
commit 6091ae31aa
7 changed files with 32 additions and 46 deletions

View File

@ -81,7 +81,6 @@ export default {
},
created() {
this.connect()
// Hook the progress bar to start before we move router-view
this.$router.beforeEach((to, from, next) => {
this.updateClipping()
if (!(to.path === from.path && to.hash)) {
@ -92,8 +91,7 @@ export default {
}
next()
})
// Hook the progress bar to finish after we've finished moving router-view
this.$router.afterEach((to, from) => {
this.$router.afterEach(() => {
this.$Progress.finish()
})
},
@ -118,7 +116,6 @@ export default {
},
openWebsocket() {
const socket = this.createWebsocket()
const vm = this
socket.onopen = () => {
socket.send(
JSON.stringify({
@ -136,46 +133,36 @@ export default {
]
})
)
vm.updateOutputs()
vm.updatePlayerStatus()
vm.updateLibraryStats()
vm.updateSettings()
vm.updateQueue()
vm.updateSpotify()
vm.updateLastfm()
vm.updatePairing()
this.updateOutputs()
this.updatePlayerStatus()
this.updateLibraryStats()
this.updateSettings()
this.updateQueue()
this.updateSpotify()
this.updateLastfm()
this.updatePairing()
}
/*
* When the app becomes active, force an update of all information,
* because we may have missed notifications while the app was inactive.
* There are two relevant events - focus and visibilitychange, so we
* throttle the updates to avoid multiple redundant updates.
*/
let updateThrottled = false
const updateInfo = () => {
if (updateThrottled) {
return
}
vm.updateOutputs()
vm.updatePlayerStatus()
vm.updateLibraryStats()
vm.updateSettings()
vm.updateQueue()
vm.updateSpotify()
vm.updateLastfm()
vm.updatePairing()
this.updateOutputs()
this.updatePlayerStatus()
this.updateLibraryStats()
this.updateSettings()
this.updateQueue()
this.updateSpotify()
this.updateLastfm()
this.updatePairing()
updateThrottled = true
setTimeout(() => {
updateThrottled = false
}, 500)
}
/*
* These events are fired when the window becomes active in different
* ways. When this happens, we should update 'now playing' info, etc.
*/
window.addEventListener('focus', updateInfo)
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
@ -189,29 +176,29 @@ export default {
data.notify.includes('update') ||
data.notify.includes('database')
) {
vm.updateLibraryStats()
this.updateLibraryStats()
}
if (
data.notify.includes('player') ||
data.notify.includes('options') ||
data.notify.includes('volume')
) {
vm.updatePlayerStatus()
this.updatePlayerStatus()
}
if (data.notify.includes('outputs') || data.notify.includes('volume')) {
vm.updateOutputs()
this.updateOutputs()
}
if (data.notify.includes('queue')) {
vm.updateQueue()
this.updateQueue()
}
if (data.notify.includes('spotify')) {
vm.updateSpotify()
this.updateSpotify()
}
if (data.notify.includes('lastfm')) {
vm.updateLastfm()
this.updateLastfm()
}
if (data.notify.includes('pairing')) {
vm.updatePairing()
this.updatePairing()
}
}
},
@ -302,7 +289,6 @@ export default {
}
})
}
},
template: '<App/>'
}
}
</script>

View File

@ -47,7 +47,7 @@ export default {
}
},
methods: {
changeVolume(value) {
changeVolume() {
webapi.player_volume(this.player.volume)
},
toggle() {

View File

@ -26,7 +26,7 @@ export const filters = {
minutes: Math.floor(seconds / 60)
}).shiftTo(...unit)
const filtered = Object.fromEntries(
Object.entries(shifted.toObject()).filter(([_, value]) => value > 0)
Object.entries(shifted.toObject()).filter(([, value]) => value > 0)
)
return Duration.fromObject(filtered, { locale: locale.value }).toHuman()
},

View File

@ -150,7 +150,7 @@ export default {
get() {
return this.queueStore.items
},
set(value) {
set() {
/* Do nothing? Send move request in @end event */
}
}

View File

@ -242,7 +242,7 @@ export const router = createRouter({
const delay = 0
if (savedPosition) {
// Use the saved scroll position (browser back/forward navigation)
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(savedPosition)
}, delay)
@ -257,7 +257,7 @@ export const router = createRouter({
}
if (to.hash) {
// We are navigating to an anchor of a new page, add a timeout to let the transition effect finish before scrolling
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve({ el: to.hash, top: TOP_WITH_TABS })
}, delay)

View File

@ -14,7 +14,7 @@ export const useQueueStore = defineStore('QueueStore', {
isPauseAllowed(state) {
return state.current && state.current.data_kind !== 'pipe'
},
isSavingAllowed(state) {
isSavingAllowed() {
const configuration = useConfigurationStore()
return (
configuration.allow_modifying_stored_playlists &&

View File

@ -28,7 +28,7 @@ export const useSettingsStore = defineStore('SettingsStore', {
}
},
getters: {
locales(state) {
locales() {
return availableLocales.map((item) => ({
id: item,
name: t(`language.${item}`)