style: shorten name operations
to op
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user