repochecker/videos: Use subtitle track language as grammar check lang
This commit is contained in:
parent
a7309b6a00
commit
1720906ec8
2 changed files with 6 additions and 4 deletions
|
|
@ -11,10 +11,9 @@ import (
|
|||
ffmpeg "github.com/u2takey/ffmpeg-go"
|
||||
|
||||
"srs.epita.fr/fic-server/admin/sync"
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
func CheckGrammarSubtitleTrack(path string, index uint, exercice *fic.Exercice, exceptions *sync.CheckExceptions) (errs []error) {
|
||||
func CheckGrammarSubtitleTrack(path string, index uint, lang string, exceptions *sync.CheckExceptions) (errs []error) {
|
||||
tmpfile, err := ioutil.TempFile("", "resolution-*.srt")
|
||||
if err != nil {
|
||||
errs = append(errs, fmt.Errorf("unable to create a temporary file: %w", err))
|
||||
|
|
@ -43,7 +42,7 @@ func CheckGrammarSubtitleTrack(path string, index uint, exercice *fic.Exercice,
|
|||
for _, e := range hooks.CallCustomHook("CheckGrammar", struct {
|
||||
Str string
|
||||
Language string
|
||||
}{Str: strings.Join(lines, "\n"), Language: exercice.Language}, exceptions) {
|
||||
}{Str: strings.Join(lines, "\n"), Language: lang[:2]}, exceptions) {
|
||||
errs = append(errs, fmt.Errorf("subtitle-track: %w", e))
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue