A fork of https://github.com/teal-fm/piper

bug: logic stuff to lfm/mbz services

Natalie B 0e749cb6 45e05bef

+4 -8
-4
service/lastfm/lastfm.go
··· 375 375 } 376 376 377 377 for _, track := range tracks { 378 - if track.Attr != nil && track.Attr.NowPlaying == "true" { 379 - continue // already handled separately 380 - } 381 - 382 378 if track.Date == nil || track.Date.UTS == "" { 383 379 log.Printf("skipping track without timestamp for %s: %s - %s", username, track.Artist.Text, track.Name) 384 380 continue
+4 -4
service/musicbrainz/musicbrainz.go
··· 281 281 firstResult := res[0] 282 282 firstResultAlbum := GetBestRelease(firstResult.Releases, firstResult.Title) 283 283 284 - bestISRC := firstResult.ISRCs[0] 285 - 286 - if len(firstResult.ISRCs) == 0 { 287 - bestISRC = track.ISRC 284 + // woof. we Might not have any ISRCs! 285 + var bestISRC string 286 + if len(firstResult.ISRCs) >= 1 { 287 + bestISRC = firstResult.ISRCs[0] 288 288 } 289 289 290 290 artists := make([]models.Artist, len(firstResult.ArtistCredit))