sync: Expose GetFileSize

This commit is contained in:
nemunaire 2022-11-21 18:55:38 +01:00
commit 257c594dbe
3 changed files with 6 additions and 6 deletions

View file

@ -263,7 +263,7 @@ func BuildExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*
e.VideoURI = path.Join(epath, "resolution.mp4")
if !i.exists(e.VideoURI) {
e.VideoURI = ""
} else if size, err := getFileSize(i, e.VideoURI); err != nil {
} else if size, err := GetFileSize(i, e.VideoURI); err != nil {
errs = append(errs, NewExerciceError(e, fmt.Errorf("resolution.mp4: %w", err), theme))
e.VideoURI = ""
} else if size == 0 {
@ -280,7 +280,7 @@ func BuildExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*
}
if i.exists(writeup) {
if size, err := getFileSize(i, writeup); err != nil {
if size, err := GetFileSize(i, writeup); err != nil {
errs = append(errs, NewExerciceError(e, fmt.Errorf("resolution.md: %w", err), theme))
} else if size == 0 {
errs = append(errs, NewExerciceError(e, fmt.Errorf("resolution.md: The file is empty!"), theme))