feat(thumb): generate and return sidecar thumb

This commit is contained in:
Aaron Liu
2023-04-07 19:26:39 +08:00
parent 7cb5e68b78
commit 62b73b577b
12 changed files with 130 additions and 52 deletions

View File

@@ -203,7 +203,7 @@ func (handler Driver) Thumb(ctx context.Context, file *model.File) (*response.Co
return nil, driver.ErrorThumbNotExist
}
thumbFile, err := handler.Get(ctx, file.SourceName+model.GetSettingByNameWithDefault("thumb_file_suffix", "._thumb"))
thumbFile, err := handler.Get(ctx, file.ThumbFile())
if err != nil {
if errors.Is(err, os.ErrNotExist) {
err = fmt.Errorf("thumb not exist: %w (%w)", err, driver.ErrorThumbNotExist)