tangled
alpha
login
or
join now
tom.sherman.is
/
piper
0
fork
atom
A fork of https://github.com/teal-fm/piper
0
fork
atom
overview
issues
pulls
pipelines
bug: logic stuff to lfm/mbz services
Natalie B
10 months ago
0e749cb6
45e05bef
+4
-8
2 changed files
expand all
collapse all
unified
split
service
lastfm
lastfm.go
musicbrainz
musicbrainz.go
-4
service/lastfm/lastfm.go
···
375
375
}
376
376
377
377
for _, track := range tracks {
378
378
-
if track.Attr != nil && track.Attr.NowPlaying == "true" {
379
379
-
continue // already handled separately
380
380
-
}
381
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
284
-
bestISRC := firstResult.ISRCs[0]
285
285
-
286
286
-
if len(firstResult.ISRCs) == 0 {
287
287
-
bestISRC = track.ISRC
284
284
+
// woof. we Might not have any ISRCs!
285
285
+
var bestISRC string
286
286
+
if len(firstResult.ISRCs) >= 1 {
287
287
+
bestISRC = firstResult.ISRCs[0]
288
288
}
289
289
290
290
artists := make([]models.Artist, len(firstResult.ArtistCredit))