Skip to content

Commit

Permalink
chore(lyric): support empty lyrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Dec 10, 2024
1 parent ed9974e commit 9ed3cbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/pkg/lyrics/lrc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9ed3cbc

Please sign in to comment.