Skip to content

Commit 9ed3cbc

Browse files
committed
chore(lyric): support empty lyrics
1 parent ed9974e commit 9ed3cbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/pkg/lyrics/lrc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ func (l *LRC) Progress() float64 {
8686
func parseLRC(text string, totalDuration time.Duration) []Lyric {
8787
lines := strings.Split(text, "\n")
8888

89+
if len(lines) == 0 {
90+
return []Lyric{}
91+
}
92+
8993
lyrics := make([]Lyric, 0, len(lines)+1)
9094
var previousTimestamp time.Duration
9195

0 commit comments

Comments
 (0)