diff --git a/web-src/src/App.vue b/web-src/src/App.vue
index e21ad49b..cd64217b 100644
--- a/web-src/src/App.vue
+++ b/web-src/src/App.vue
@@ -143,15 +143,13 @@ export default {
return
}
- const vm = this
-
let protocol = 'ws://'
if (window.location.protocol === 'https:') {
protocol = 'wss://'
}
let wsUrl = `${protocol + window.location.hostname}:${
- vm.$store.state.config.websocket_port
+ this.$store.state.config.websocket_port
}`
if (import.meta.env.DEV && import.meta.env.VITE_OWNTONE_URL) {
@@ -161,7 +159,7 @@ export default {
*/
const owntoneUrl = new URL(import.meta.env.VITE_OWNTONE_URL)
wsUrl = `${protocol + owntoneUrl.hostname}:${
- vm.$store.state.config.websocket_port
+ this.$store.state.config.websocket_port
}`
}
@@ -170,6 +168,7 @@ export default {
maxReconnectInterval: 2000
})
+ const vm = this
socket.onopen = () => {
vm.reconnect_attempts = 0
socket.send(
@@ -188,7 +187,6 @@ export default {
]
})
)
-
vm.update_outputs()
vm.update_player_status()
vm.update_library_stats()
@@ -207,11 +205,10 @@ export default {
*/
let update_throttled = false
- function update_info() {
+ const update_info = () => {
if (update_throttled) {
return
}
-
vm.update_outputs()
vm.update_player_status()
vm.update_library_stats()
@@ -220,7 +217,6 @@ export default {
vm.update_spotify()
vm.update_lastfm()
vm.update_pairing()
-
update_throttled = true
setTimeout(() => {
update_throttled = false
diff --git a/web-src/src/components/IndexButtonList.vue b/web-src/src/components/IndexButtonList.vue
index 92853ada..22b02623 100644
--- a/web-src/src/components/IndexButtonList.vue
+++ b/web-src/src/components/IndexButtonList.vue
@@ -6,8 +6,9 @@
:key="index"
class="button is-small"
:to="{ hash: `#index_${index}`, query: $route.query }"
- >{{ index }}
+ {{ index }}
+
diff --git a/web-src/src/components/LyricsPane.vue b/web-src/src/components/LyricsPane.vue
index 3eaea074..c7868114 100644
--- a/web-src/src/components/LyricsPane.vue
+++ b/web-src/src/components/LyricsPane.vue
@@ -68,17 +68,19 @@ export default {
(this.lastIndex < la.length - 1 &&
la[this.lastIndex + 1].time > currentTime) ||
this.lastIndex === la.length - 1
- )
+ ) {
return this.lastIndex
+ }
if (
this.lastIndex < la.length - 2 &&
la[this.lastIndex + 2].time > currentTime
- )
+ ) {
return this.lastIndex + 1
+ }
// Not found, then start a binary search
- let start = 0,
- end = la.length - 1,
- index
+ let end = la.length - 1,
+ index = 0,
+ start = 0
while (start <= end) {
index = (start + end) >> 1
const currentVerse = la[index]
@@ -103,7 +105,7 @@ export default {
const parsed = []
if (raw) {
// Parse the lyrics
- const regex = /(\[(\d+):(\d+)(?:\.\d+)?\] ?)?(.*)/
+ const regex = /(\[(\d+):(\d+)(?:\.\d+)?\] ?)?(.*)/u
raw.split('\n').forEach((item, index) => {
const matches = regex.exec(item)
if (matches && matches[4]) {
@@ -120,7 +122,7 @@ export default {
index < lyrics.length - 1 ? lyrics[index + 1].time - verse.time : 3
const unitDuration = duration / verse.text.length
let delay = 0
- verse.words = verse.text.match(/\S+\s*/g).map((text) => {
+ verse.words = verse.text.match(/\S+\s*/gu).map((text) => {
const duration = text.length * unitDuration
delay += duration
return {
diff --git a/web-src/src/components/NavbarBottom.vue b/web-src/src/components/NavbarBottom.vue
index 6105c726..fa60e6bc 100644
--- a/web-src/src/components/NavbarBottom.vue
+++ b/web-src/src/components/NavbarBottom.vue
@@ -60,7 +60,8 @@
'is-loading': loading
}"
@click="togglePlay"
- >