Update all the shit
This commit is contained in:
@ -24,6 +24,10 @@ func (cs *CaptureService) DeleteCapture(ctx context.Context, id int64) error {
|
||||
return cs.p.DeleteCapture(ctx, id)
|
||||
}
|
||||
|
||||
func (cs *CaptureService) SetMapScoreConted(ctx context.Context, id int64, counted bool) error {
|
||||
return cs.p.SetMapScoreConted(ctx, id, counted)
|
||||
}
|
||||
|
||||
func (cs *CaptureService) GetActiveCapures(ctx context.Context) ([]models.Capture, error) {
|
||||
captures, err := cs.p.GetCaptures(ctx)
|
||||
if err != nil {
|
||||
|
||||
@ -70,6 +70,7 @@ func (s *Scanner) fetchInformation(ctx context.Context, capture models.Capture)
|
||||
CaptureID: capture.ID,
|
||||
StartTime: status.MapStartTime,
|
||||
Map: status.MapName,
|
||||
Counted: true,
|
||||
}
|
||||
|
||||
err := s.p.CreateMapScore(ctx, &newMap)
|
||||
@ -89,5 +90,9 @@ func (s *Scanner) fetchInformation(ctx context.Context, capture models.Capture)
|
||||
scores = append(scores, score)
|
||||
}
|
||||
|
||||
if len(scores) <= 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return s.p.CreateOrUpdateScores(ctx, scores)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user