mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
fix(fs): only list parent dir for related objs when file is video (#3113)
This commit is contained in:
@@ -347,12 +347,14 @@ func FsGet(c *gin.Context, req *FsGetReq, user *model.User) {
|
||||
}
|
||||
}
|
||||
}
|
||||
var related []model.Obj
|
||||
parentPath := stdpath.Dir(reqPath)
|
||||
var related []model.Obj
|
||||
if !obj.IsDir() && utils.GetFileType(obj.GetName()) == conf.VIDEO {
|
||||
sameLevelFiles, err := fs.List(c.Request.Context(), parentPath, &fs.ListArgs{})
|
||||
if err == nil {
|
||||
related = filterRelated(sameLevelFiles, obj)
|
||||
}
|
||||
}
|
||||
parentMeta, _ := op.GetNearestMeta(parentPath)
|
||||
thumb, _ := model.GetThumb(obj)
|
||||
mountDetails, _ := model.GetStorageDetails(obj)
|
||||
|
||||
@@ -68,10 +68,12 @@ func (s *Server) callFSGet(c *gin.Context, raw json.RawMessage) (any, *rpcError)
|
||||
|
||||
parentPath := stdpath.Dir(reqPath)
|
||||
var related []model.Obj
|
||||
if !obj.IsDir() && utils.GetFileType(obj.GetName()) == conf.VIDEO {
|
||||
sameLevelFiles, err := fs.List(ctx, parentPath, &fs.ListArgs{})
|
||||
if err == nil {
|
||||
related = filterRelatedObjs(sameLevelFiles, obj)
|
||||
}
|
||||
}
|
||||
|
||||
parentMeta, _ := op.GetNearestMeta(parentPath)
|
||||
thumb, _ := model.GetThumb(obj)
|
||||
|
||||
Reference in New Issue
Block a user