Skip to content

Commit

Permalink
Merge pull request #632 from brotherlogic/hmm
Browse files Browse the repository at this point in the history
hmm
  • Loading branch information
brotherlogic committed Feb 26, 2020
2 parents 1fe805e + 8611fcf commit 92a7c20
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cdprocessorutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func computeArtist(rec *pbgd.Release) string {

func (s *Server) makeLinks(ctx context.Context, ID int32, force bool) error {
if val, ok := s.config.LastProcessTime[ID]; ok {
if time.Now().Sub(time.Unix(val, 0)) < time.Hour*24 {
if time.Now().Sub(time.Unix(val, 0)) < time.Hour*24 && !force {
return status.Error(codes.ResourceExhausted, "This has been linked recently")
}
}
Expand Down
25 changes: 25 additions & 0 deletions recordutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,3 +873,28 @@ func TestRunExtractKnot(t *testing.T) {

log.Printf("WHAT %+v", tracks[len(tracks)-1])
}

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

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

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

tracks := TrackExtract(record.GetRelease())

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

log.Printf("WHAT %+v", tracks[len(tracks)-1])
}

0 comments on commit 92a7c20

Please sign in to comment.