mirror of
https://github.com/owntone/owntone-server.git
synced 2025-07-19 13:38:59 -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-config-prettier": "^10.1.5",
|
||||||
"eslint-plugin-vue": "^10.1.0",
|
"eslint-plugin-vue": "^10.1.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"sass": "^1.87.0",
|
"sass": "^1.88.0",
|
||||||
"vite": "^6.3.5"
|
"vite": "^6.3.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4379,9 +4379,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
"node_modules/sass": {
|
||||||
"version": "1.87.0",
|
"version": "1.88.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.87.0.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.88.0.tgz",
|
||||||
"integrity": "sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==",
|
"integrity": "sha512-sF6TWQqjFvr4JILXzG4ucGOLELkESHL+I5QJhh7CNaE+Yge0SI+ehCatsXhJ7ymU1hAFcIS3/PBpjdIbXoyVbg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
"eslint-config-prettier": "^10.1.5",
|
"eslint-config-prettier": "^10.1.5",
|
||||||
"eslint-plugin-vue": "^10.1.0",
|
"eslint-plugin-vue": "^10.1.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"sass": "^1.87.0",
|
"sass": "^1.88.0",
|
||||||
"vite": "^6.3.5"
|
"vite": "^6.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,17 +110,15 @@ export default {
|
|||||||
/\[(?<minutes>\d+):(?<seconds>\d+)(?:\.(?<hundredths>\d+))?\] ?(?<text>.*)/u
|
/\[(?<minutes>\d+):(?<seconds>\d+)(?:\.(?<hundredths>\d+))?\] ?(?<text>.*)/u
|
||||||
this.playerStore.lyricsContent.split('\n').forEach((line) => {
|
this.playerStore.lyricsContent.split('\n').forEach((line) => {
|
||||||
const match = regex.exec(line)
|
const match = regex.exec(line)
|
||||||
if (match?.groups?.text) {
|
if (match) {
|
||||||
const { text, minutes, seconds, hundredths } = match.groups
|
const { text, minutes, seconds, hundredths } = match.groups
|
||||||
const verse = {
|
const verse = text.trim()
|
||||||
text,
|
if (verse) {
|
||||||
time:
|
const time =
|
||||||
(Number(minutes) * 60 + Number(`${seconds}.${hundredths ?? 0}`)) *
|
(Number(minutes) * 60 + Number(`${seconds}.${hundredths ?? 0}`)) *
|
||||||
1000
|
1000
|
||||||
|
verses.push({ text: verse, time })
|
||||||
}
|
}
|
||||||
verses.push(verse)
|
|
||||||
} else {
|
|
||||||
verses.push({ text: line.trim() })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
verses.forEach((verse, index, lyrics) => {
|
verses.forEach((verse, index, lyrics) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user