mirror of
https://github.com/owntone/owntone-server.git
synced 2025-07-18 21:18:57 -04:00
[web] Fix last line of timed lyrics
This commit is contained in:
parent
775eac28a5
commit
136732b024
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
8
web-src/package-lock.json
generated
8
web-src/package-lock.json
generated
@ -32,7 +32,7 @@
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-vue": "^10.1.0",
|
||||
"prettier": "^3.5.3",
|
||||
"sass": "^1.87.0",
|
||||
"sass": "^1.88.0",
|
||||
"vite": "^6.3.5"
|
||||
}
|
||||
},
|
||||
@ -4379,9 +4379,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.87.0",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.87.0.tgz",
|
||||
"integrity": "sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==",
|
||||
"version": "1.88.0",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.88.0.tgz",
|
||||
"integrity": "sha512-sF6TWQqjFvr4JILXzG4ucGOLELkESHL+I5QJhh7CNaE+Yge0SI+ehCatsXhJ7ymU1hAFcIS3/PBpjdIbXoyVbg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@ -36,7 +36,7 @@
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-vue": "^10.1.0",
|
||||
"prettier": "^3.5.3",
|
||||
"sass": "^1.87.0",
|
||||
"sass": "^1.88.0",
|
||||
"vite": "^6.3.5"
|
||||
}
|
||||
}
|
||||
|
@ -110,17 +110,15 @@ export default {
|
||||
/\[(?<minutes>\d+):(?<seconds>\d+)(?:\.(?<hundredths>\d+))?\] ?(?<text>.*)/u
|
||||
this.playerStore.lyricsContent.split('\n').forEach((line) => {
|
||||
const match = regex.exec(line)
|
||||
if (match?.groups?.text) {
|
||||
if (match) {
|
||||
const { text, minutes, seconds, hundredths } = match.groups
|
||||
const verse = {
|
||||
text,
|
||||
time:
|
||||
const verse = text.trim()
|
||||
if (verse) {
|
||||
const time =
|
||||
(Number(minutes) * 60 + Number(`${seconds}.${hundredths ?? 0}`)) *
|
||||
1000
|
||||
verses.push({ text: verse, time })
|
||||
}
|
||||
verses.push(verse)
|
||||
} else {
|
||||
verses.push({ text: line.trim() })
|
||||
}
|
||||
})
|
||||
verses.forEach((verse, index, lyrics) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user