Update all the shit

This commit is contained in:
Henri Burau
2024-06-07 00:07:29 +02:00
parent ddbfc32fb1
commit 18265f59df
43 changed files with 609 additions and 182 deletions

View File

@ -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 {

View File

@ -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)
}