Skip to content

Commit

Permalink
Merge e01e889 into cfe4839
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlogic committed Sep 5, 2019
2 parents cfe4839 + e01e889 commit 5d0edf6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Binary file added cdtests/8450627.data
Binary file not shown.
1 change: 1 addition & 0 deletions recordutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func getFormatAndDisk(t *pbgd.Track) (string, int) {
disk, _ := strconv.Atoi(baselines[0][2:])
return "Vinyl", disk
}
return "Vinyl", -1
}

if baselines[0] == "Vinyl" || strings.HasPrefix(baselines[0], "LP") ||
Expand Down
23 changes: 23 additions & 0 deletions recordutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,26 @@ func TestRunExtractGate(t *testing.T) {
t.Errorf("Bad spec")
}
}

func TestRunExtractBedazzled(t *testing.T) {
data, err := ioutil.ReadFile("cdtests/8450627.data")

if err != nil {
t.Fatalf("Error: %v", err)
}

record := &pbrc.Record{}
proto.Unmarshal(data, record)

tracks := TrackExtract(record.GetRelease())

if len(tracks) != 16 || tracks[14].Format != "Vinyl" || tracks[14].Disk != "2" {
for i, tr := range tracks {
log.Printf("%v. %v (%v-%v)", i, len(tr.tracks), tr.Format, tr.Disk)
for j, trs := range tr.tracks {
log.Printf(" %v. %v", j, trs.Title)
}
}
t.Errorf("Bad spec")
}
}

0 comments on commit 5d0edf6

Please sign in to comment.