2022-10-31 14:03:30 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2023-11-22 11:16:53 +00:00
|
|
|
"go.uber.org/multierr"
|
|
|
|
|
2022-10-31 14:03:30 +00:00
|
|
|
"srs.epita.fr/fic-server/admin/sync"
|
|
|
|
"srs.epita.fr/fic-server/libfic"
|
|
|
|
)
|
|
|
|
|
2022-10-31 16:00:37 +00:00
|
|
|
var hooks *sync.CheckHooks
|
2022-10-31 14:03:30 +00:00
|
|
|
|
2022-10-31 16:00:37 +00:00
|
|
|
func RegisterChecksHooks(h *sync.CheckHooks) {
|
|
|
|
hooks = h
|
2022-10-31 14:03:30 +00:00
|
|
|
|
2022-10-31 16:00:37 +00:00
|
|
|
h.RegisterExerciceHook(CheckResolutionVideo)
|
|
|
|
}
|
2022-10-31 14:03:30 +00:00
|
|
|
|
2023-11-22 11:16:53 +00:00
|
|
|
func CheckResolutionVideo(e *fic.Exercice, exceptions *sync.CheckExceptions) (errs error) {
|
|
|
|
for _, err := range multierr.Errors(checkResolutionVideo(e, exceptions)) {
|
|
|
|
errs = multierr.Append(errs, fmt.Errorf("resolution.mp4: %w", err))
|
2022-10-31 14:03:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|