sync: Don't overwrite theme image if it exists
This commit is contained in:
parent
9e6a03c681
commit
f4d0e0001c
@ -400,10 +400,15 @@ func SyncExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*f
|
||||
e.BackgroundColor, _ = getBackgroundColor(filePath)
|
||||
|
||||
// If the theme has no image yet, use the first exercice's image found
|
||||
if theme != nil && theme.Image == "" {
|
||||
theme.Image = e.Image
|
||||
_, err := theme.Update()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}); err != nil {
|
||||
errs = multierr.Append(errs, NewExerciceError(e, fmt.Errorf("unable to import heading image: %w", err)))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user