diff --git a/drivers/115_open/driver.go b/drivers/115_open/driver.go index 278ae0f7f..b7632f761 100644 --- a/drivers/115_open/driver.go +++ b/drivers/115_open/driver.go @@ -14,6 +14,7 @@ import ( "github.com/OpenListTeam/OpenList/v4/cmd/flags" "github.com/OpenListTeam/OpenList/v4/drivers/base" "github.com/OpenListTeam/OpenList/v4/internal/driver" + "github.com/OpenListTeam/OpenList/v4/internal/errs" "github.com/OpenListTeam/OpenList/v4/internal/model" "github.com/OpenListTeam/OpenList/v4/internal/op" "github.com/OpenListTeam/OpenList/v4/internal/stream" @@ -169,6 +170,9 @@ func (d *Open115) Get(ctx context.Context, path string) (model.Obj, error) { path = stdpath.Join(d.parentPath, path) resp, err := d.client.GetFolderInfoByPath(ctx, path) if err != nil { + if strings.Contains(err.Error(), "cannot unmarshal array") { + return nil, errs.NotSupport + } return nil, err } return &Obj{ @@ -218,7 +222,7 @@ func (d *Open115) Rename(ctx context.Context, srcObj model.Obj, newName string) return nil, err } _, err := d.client.UpdateFile(ctx, &sdk.UpdateFileReq{ - FileID: srcObj.GetID(), + FileID: srcObj.GetID(), FileName: newName, }) if err != nil { diff --git a/drivers/115_open/types.go b/drivers/115_open/types.go index 0bd95bfd1..493772a58 100644 --- a/drivers/115_open/types.go +++ b/drivers/115_open/types.go @@ -3,9 +3,9 @@ package _115_open import ( "time" + sdk "github.com/OpenListTeam/115-sdk-go" "github.com/OpenListTeam/OpenList/v4/internal/model" "github.com/OpenListTeam/OpenList/v4/pkg/utils" - sdk "github.com/OpenListTeam/115-sdk-go" ) type Obj sdk.GetFilesResp_File diff --git a/internal/op/fs.go b/internal/op/fs.go index f7b1c45b5..0f515af57 100644 --- a/internal/op/fs.go +++ b/internal/op/fs.go @@ -426,10 +426,11 @@ func Move(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string } if cache, exist := Cache.dirCache.Get(dstKey); exist { if newObj == nil { - newObj = &model.ObjWrapMask{Obj: srcRawObj, Mask: model.Temp} + newObj = srcRawObj } else { newObj = wrapObjName(storage, newObj) } + newObj = &model.ObjWrapMask{Obj: newObj, Mask: model.Temp} cache.UpdateObject(srcRawObj.GetName(), newObj) } } @@ -551,10 +552,11 @@ func Copy(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string if !storage.Config().NoCache { if cache, exist := Cache.dirCache.Get(dstKey); exist { if newObj == nil { - newObj = &model.ObjWrapMask{Obj: srcRawObj, Mask: model.Temp} + newObj = srcRawObj } else { newObj = wrapObjName(storage, newObj) } + newObj = &model.ObjWrapMask{Obj: newObj, Mask: model.Temp} cache.UpdateObject(srcRawObj.GetName(), newObj) } }