Skip to content

Commit

Permalink
fixed metadata title
Browse files Browse the repository at this point in the history
  • Loading branch information
LumePart committed Oct 28, 2024
1 parent b99a138 commit 718083c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/listenbrainz.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ func getTracks(mbids []string, singleArtist bool) []Track {
if singleArtist { // if artist separator is empty, only append the first artist
if len(recording.Artist.Artists) > 1 {
var tempTitle string
for _, artist := range recording.Artist.Artists[1:] {
tempTitle += fmt.Sprintf("%s%s",artist.Name, artist.JoinPhrase)
for i, artist := range recording.Artist.Artists[1:] {
tempTitle += fmt.Sprintf("%s%s",recording.Artist.Artists[i-1], artist.Name)

Check failure on line 155 in src/listenbrainz.go

View workflow job for this annotation

GitHub Actions / Lint files

printf: fmt.Sprintf format %s has arg recording.Artist.Artists[i-1] of wrong type struct{ArtistMbid string "json:\"artist_mbid\""; BeginYear int "json:\"begin_year\""; EndYear int "json:\"end_year,omitempty\""; JoinPhrase string "json:\"join_phrase\""; Name string "json:\"name\""} (govet)
}
title = fmt.Sprintf("%s (%s)", recording.Recording.Name, tempTitle)
}
Expand Down Expand Up @@ -221,8 +221,8 @@ func parseWeeklyExploration(identifier string, singleArtist bool) []Track {
if singleArtist { // if artist separator is empty, only append the first artist
if len(track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists) > 1 {
var tempTitle string
for _, artist := range track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists[1:] {
tempTitle += fmt.Sprintf("%s%s",artist.ArtistCreditName, artist.JoinPhrase)
for i, artist := range track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists[1:] {
tempTitle += fmt.Sprintf("%s%s",track.Extension.HTTPSMusicbrainzOrgDocJspfTrack.AdditionalMetadata.Artists[i-1], artist.ArtistCreditName)
}
title = fmt.Sprintf("%s (%s)", track.Title, tempTitle)
}
Expand Down

0 comments on commit 718083c

Please sign in to comment.