#748: LrcLib fetcher - don't crash if song has no artist name tagged

This commit is contained in:
Drew Weymouth
2025-11-14 08:40:47 -08:00
parent a884795a78
commit e883c387f3
+5 -1
View File
@@ -63,7 +63,11 @@ func (lm *LyricsManager) fetchLyrics(ctx context.Context, song *mediaprovider.Tr
}
}
if lyrics == nil && lm.lrclib != nil {
lyrics, err = lm.lrclib.FetchLrcLibLyrics(song.Title, song.ArtistNames[0], song.Album, int(song.Duration.Seconds()))
artist := ""
if len(song.ArtistNames) > 0 {
artist = song.ArtistNames[0]
}
lyrics, err = lm.lrclib.FetchLrcLibLyrics(song.Title, artist, song.Album, int(song.Duration.Seconds()))
if err != nil {
log.Println(err.Error())
}