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
|
|
@ -148,11 +148,14 @@ func checkResolutionVideo(e *fic.Exercice, exceptions *sync.CheckExceptions) (er
|
|||
errs = append(errs, fmt.Errorf("no subtitles track found"))
|
||||
} else if len(subtitles_seen) > 0 {
|
||||
for _, idx := range subtitles_seen {
|
||||
language := e.Language
|
||||
if lang, ok := vInfo.Streams[idx].Tags["language"]; e.Language != "" && (!ok || lang == "" || lang == "und") {
|
||||
errs = append(errs, fmt.Errorf("subtitles track %d with no language defined", vInfo.Streams[idx].Index))
|
||||
} else {
|
||||
language = lang
|
||||
}
|
||||
|
||||
errs = append(errs, CheckGrammarSubtitleTrack(path, vInfo.Streams[idx].Index, e, exceptions)...)
|
||||
errs = append(errs, CheckGrammarSubtitleTrack(path, vInfo.Streams[idx].Index, language, exceptions)...)
|
||||
}
|
||||
|
||||
if e.Language != "" && len(subtitles_seen) < 2 {
|
||||
|
|
|
|||
Reference in a new issue