mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-16 07:06:25 +08:00
feat: add root prefix before operate
This commit is contained in:
@@ -12,5 +12,5 @@ func Get(ctx context.Context, path string) (driver.FileInfo, error) {
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "failed get account")
|
||||
}
|
||||
return account.File(ctx, actualPath)
|
||||
return operations.Get(ctx, account, actualPath)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
// List files
|
||||
// TODO: hide
|
||||
// TODO: sort
|
||||
// TODO: cache, and prevent cache breakdown
|
||||
func List(ctx context.Context, path string) ([]driver.FileInfo, error) {
|
||||
account, actualPath, err := operations.GetAccountAndActualPath(path)
|
||||
virtualFiles := operations.GetAccountVirtualFilesByPath(path)
|
||||
@@ -21,7 +20,7 @@ func List(ctx context.Context, path string) ([]driver.FileInfo, error) {
|
||||
}
|
||||
return nil, errors.WithMessage(err, "failed get account")
|
||||
}
|
||||
files, err := account.List(ctx, actualPath)
|
||||
files, err := operations.List(ctx, account, actualPath)
|
||||
if err != nil {
|
||||
log.Errorf("%+v", err)
|
||||
if len(virtualFiles) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user