[web] Format source code

This commit is contained in:
Alain Nussbaumer 2023-11-26 15:59:14 +01:00
parent a9092e54c0
commit 66b1e444d1

View File

@ -80,21 +80,19 @@ export default {
lyrics() { lyrics() {
const lyrics = this.$store.getters.lyrics const lyrics = this.$store.getters.lyrics
const lyricsObj = [] const lyricsObj = []
if (lyrics) { if (lyrics) {
const regex = /(\[(\d+):(\d+)(?:\.\d+)?\] ?)?(.*)/ const regex = /(\[(\d+):(\d+)(?:\.\d+)?\] ?)?(.*)/
lyrics.split('\n').forEach((item) => { lyrics.split('\n').forEach((item) => {
const matches = regex.exec(item) const matches = regex.exec(item)
if (matches && matches[4]) { if (matches && matches[4]) {
const obj = [matches[4]] const obj = [matches[4]]
if (matches[2] && matches[3]) if (matches[2] && matches[3])
obj.push( obj.push(matches[2] * 60 + matches[3] * 1)
matches[2] * 60 + matches[3] * 1 lyricsObj.push(obj)
) }
lyricsObj.push(obj) })
} }
}) return lyricsObj
}
return lyricsObj
}, },
player() { player() {
return this.$store.state.player return this.$store.state.player