refactored some functions, added demo download retry

This commit is contained in:
2021-10-09 19:10:38 +02:00
parent 15b273f052
commit e938b05f52
13 changed files with 242 additions and 322 deletions

View File

@@ -92,20 +92,6 @@ func (mc *MatchCreate) SetMaxRounds(i int) *MatchCreate {
return mc
}
// SetDemoExpired sets the "demo_expired" field.
func (mc *MatchCreate) SetDemoExpired(b bool) *MatchCreate {
mc.mutation.SetDemoExpired(b)
return mc
}
// SetNillableDemoExpired sets the "demo_expired" field if the given value is not nil.
func (mc *MatchCreate) SetNillableDemoExpired(b *bool) *MatchCreate {
if b != nil {
mc.SetDemoExpired(*b)
}
return mc
}
// SetDemoParsed sets the "demo_parsed" field.
func (mc *MatchCreate) SetDemoParsed(b bool) *MatchCreate {
mc.mutation.SetDemoParsed(b)
@@ -253,10 +239,6 @@ func (mc *MatchCreate) ExecX(ctx context.Context) {
// defaults sets the default values of the builder before save.
func (mc *MatchCreate) defaults() {
if _, ok := mc.mutation.DemoExpired(); !ok {
v := match.DefaultDemoExpired
mc.mutation.SetDemoExpired(v)
}
if _, ok := mc.mutation.DemoParsed(); !ok {
v := match.DefaultDemoParsed
mc.mutation.SetDemoParsed(v)
@@ -286,9 +268,6 @@ func (mc *MatchCreate) check() error {
if _, ok := mc.mutation.MaxRounds(); !ok {
return &ValidationError{Name: "max_rounds", err: errors.New(`ent: missing required field "max_rounds"`)}
}
if _, ok := mc.mutation.DemoExpired(); !ok {
return &ValidationError{Name: "demo_expired", err: errors.New(`ent: missing required field "demo_expired"`)}
}
if _, ok := mc.mutation.DemoParsed(); !ok {
return &ValidationError{Name: "demo_parsed", err: errors.New(`ent: missing required field "demo_parsed"`)}
}
@@ -397,14 +376,6 @@ func (mc *MatchCreate) createSpec() (*Match, *sqlgraph.CreateSpec) {
})
_node.MaxRounds = value
}
if value, ok := mc.mutation.DemoExpired(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeBool,
Value: value,
Column: match.FieldDemoExpired,
})
_node.DemoExpired = value
}
if value, ok := mc.mutation.DemoParsed(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeBool,