Feat: thumb for shared folder

This commit is contained in:
HFO4
2020-02-01 10:34:23 +08:00
parent 9fe451ad4b
commit 437bdf46d4
4 changed files with 81 additions and 0 deletions

View File

@@ -311,6 +311,13 @@ func (fs *FileSystem) resetFileIDIfNotExist(ctx context.Context, id uint) error
fs.FileTarget = []model.File{file[0]}
}
// 如果上下文限制了父目录,则进行检查
if parent, ok := ctx.Value(fsctx.LimitParentCtx).(*model.Folder); ok {
if parent.ID != fs.FileTarget[0].FolderID {
return ErrObjectNotExist
}
}
// 将当前存储策略重设为文件使用的
return fs.resetPolicyToFirstFile(ctx)
}