sync: check video file size during import process
This commit is contained in:
parent
2ac205bf83
commit
6042f9b477
2 changed files with 45 additions and 0 deletions
|
|
@ -178,6 +178,12 @@ func SyncExercice(i Importer, theme fic.Theme, epath string, dmap *map[int64]fic
|
|||
if !i.exists(e.VideoURI) {
|
||||
errs = append(errs, fmt.Sprintf("%q: resolution.mp4: no video file found at %s", edir, e.VideoURI))
|
||||
e.VideoURI = ""
|
||||
} else if size, err := getFileSize(i, e.VideoURI); err != nil {
|
||||
errs = append(errs, fmt.Sprintf("%q: resolution.mp4: ", edir, err))
|
||||
e.VideoURI = ""
|
||||
} else if size == 0 {
|
||||
errs = append(errs, fmt.Sprintf("%q: resolution.mp4: The file is empty!", edir))
|
||||
e.VideoURI = ""
|
||||
}
|
||||
|
||||
// Create or update the exercice
|
||||
|
|
|
|||
Reference in a new issue