From 9ed3cbceea68b2d3224bfc9fb8fa4771182df927 Mon Sep 17 00:00:00 2001 From: Topvennie Date: Tue, 10 Dec 2024 21:13:51 +0100 Subject: [PATCH] chore(lyric): support empty lyrics --- internal/pkg/lyrics/lrc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/pkg/lyrics/lrc.go b/internal/pkg/lyrics/lrc.go index a4ec841..f38b9ad 100644 --- a/internal/pkg/lyrics/lrc.go +++ b/internal/pkg/lyrics/lrc.go @@ -86,6 +86,10 @@ func (l *LRC) Progress() float64 { func parseLRC(text string, totalDuration time.Duration) []Lyric { lines := strings.Split(text, "\n") + if len(lines) == 0 { + return []Lyric{} + } + lyrics := make([]Lyric, 0, len(lines)+1) var previousTimestamp time.Duration