Skip to content

Commit bee02a6

Browse files
committed
fix(115_share): fix the file path
1 parent 4fd370f commit bee02a6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/115_share/driver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package _115_share
22

33
import (
44
"context"
5+
"path/filepath"
56

67
"github.com/OpenListTeam/OpenList/v4/drivers/virtual_file"
78
"github.com/OpenListTeam/OpenList/v4/internal/driver"
@@ -58,7 +59,7 @@ func (d *Pan115Share) List(ctx context.Context, dir model.Obj, args model.ListAr
5859
if virDir, ok := dir.(*model.ObjVirtualDir); ok {
5960
parentId = virDir.VirtualFile.ParentDir
6061
} else {
61-
parentId = dir.GetID()
62+
parentId = filepath.Base(dir.GetPath())
6263
}
6364

6465
files := make([]driver115.ShareFile, 0)

drivers/115_share/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func transFunc(parent model.Obj, sf driver115.ShareFile) (model.Obj, error) {
8080
FileName: string(sf.FileName),
8181
isDir: isDir,
8282
FileID: fileID,
83-
Path: filepath.Join(parent.GetPath(), sf.FileID),
83+
Path: filepath.Join(parent.GetPath(), fileID),
8484
}, nil
8585
}
8686

0 commit comments

Comments
 (0)