feat: add thumbnail to `fs/get` api (#3927)

pull/3928/head
zhengxiexie 2023-03-23 13:59:39 +08:00 committed by GitHub
parent b2a5110672
commit c6af22b97e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -293,6 +293,7 @@ func FsGet(c *gin.Context) {
related = filterRelated(sameLevelFiles, obj)
}
parentMeta, _ := op.GetNearestMeta(parentPath)
thumb, _ := model.GetThumb(obj)
common.SuccessResp(c, FsGetResp{
ObjResp: ObjResp{
Name: obj.GetName(),
@ -301,6 +302,7 @@ func FsGet(c *gin.Context) {
Modified: obj.ModTime(),
Sign: common.Sign(obj, parentPath, isEncrypt(meta, reqPath)),
Type: utils.GetFileType(obj.GetName()),
Thumb: thumb,
},
RawURL: rawURL,
Readme: getReadme(meta, reqPath),