feat: virtual path
This commit is contained in:
@ -50,17 +50,18 @@ func (fs *FileSystem) File(rawPath string) (*model.File, error) {
|
||||
|
||||
func (fs *FileSystem) Files(ctx context.Context, rawPath string) ([]model.File, error) {
|
||||
rawPath = utils.ParsePath(rawPath)
|
||||
var files []model.File
|
||||
var err error
|
||||
if model.AccountsCount() > 1 && rawPath == "/" {
|
||||
files, err = model.GetAccountFiles()
|
||||
} else {
|
||||
account, path_, driver, err := common.ParsePath(rawPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
files, err = operate.Files(driver, account, path_)
|
||||
}
|
||||
//var files []model.File
|
||||
//var err error
|
||||
//if model.AccountsCount() > 1 && rawPath == "/" {
|
||||
// files, err = model.GetAccountFilesByPath("/")
|
||||
//} else {
|
||||
// account, path_, driver, err := common.ParsePath(rawPath)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// files, err = operate.Files(driver, account, path_)
|
||||
//}
|
||||
_, files, _, _, _, err := common.Path(rawPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user