style: shorten name operations to op

This commit is contained in:
Noah Hsu
2022-08-31 21:01:15 +08:00
parent 9ec6d5be7a
commit 7ac1d14eeb
35 changed files with 110 additions and 110 deletions

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/internal/op"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors"
)
@ -15,14 +15,14 @@ func get(ctx context.Context, path string) (model.Obj, error) {
path = utils.StandardizePath(path)
// maybe a virtual file
if path != "/" {
virtualFiles := operations.GetStorageVirtualFilesByPath(stdpath.Dir(path))
virtualFiles := op.GetStorageVirtualFilesByPath(stdpath.Dir(path))
for _, f := range virtualFiles {
if f.GetName() == stdpath.Base(path) {
return f, nil
}
}
}
storage, actualPath, err := operations.GetStorageAndActualPath(path)
storage, actualPath, err := op.GetStorageAndActualPath(path)
if err != nil {
// if there are no storage prefix with path, maybe root folder
if path == "/" {
@ -35,5 +35,5 @@ func get(ctx context.Context, path string) (model.Obj, error) {
}
return nil, errors.WithMessage(err, "failed get storage")
}
return operations.Get(ctx, storage, actualPath)
return op.Get(ctx, storage, actualPath)
}