Skip to content

Commit

Permalink
feat(alias): support thumbnail (close #4256)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Apr 27, 2023
1 parent b7ea73b commit 4bf4626
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/alias/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,21 @@ func (d *Alias) list(ctx context.Context, dst, sub string) ([]model.Obj, error)
return nil, err
}
return utils.SliceConvert(objs, func(obj model.Obj) (model.Obj, error) {
return &model.Object{
thumb, ok := model.GetThumb(obj)
objRes := model.Object{
Name: obj.GetName(),
Size: obj.GetSize(),
Modified: obj.ModTime(),
IsFolder: obj.IsDir(),
}
if !ok {
return &objRes, nil
}
return &model.ObjThumb{
Object: objRes,
Thumbnail: model.Thumbnail{
Thumbnail: thumb,
},
}, nil
})
}
Expand Down

0 comments on commit 4bf4626

Please sign in to comment.