Skip to content

Commit

Permalink
fixed index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
LumePart committed Oct 28, 2024
1 parent d6780c0 commit a4083b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/listenbrainz.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func getTracks(mbids []string, singleArtist bool) []Track {
if len(recording.Artist.Artists) > 1 {
var tempTitle string
for i, artist := range recording.Artist.Artists[1:] {
tempTitle += fmt.Sprintf("%s%s",recording.Artist.Artists[i-1].JoinPhrase, artist.Name)
tempTitle += fmt.Sprintf("%s%s",recording.Artist.Artists[i].JoinPhrase, artist.Name)
}
title = fmt.Sprintf("%s (%s)", recording.Recording.Name, tempTitle)
}
Expand Down Expand Up @@ -222,7 +222,7 @@ func parseWeeklyExploration(identifier string, singleArtist bool) []Track {
if len(track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists) > 1 {
var tempTitle string
for i, artist := range track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists[1:] {
tempTitle += fmt.Sprintf("%s%s",track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists[i-1], artist.ArtistCreditName)
tempTitle += fmt.Sprintf("%s%s",track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists[i], artist.ArtistCreditName)
}
title = fmt.Sprintf("%s (%s)", track.Title, tempTitle)
}
Expand Down

0 comments on commit a4083b3

Please sign in to comment.