chore!: change root folder

This commit is contained in:
Noah Hsu
2022-09-04 13:07:53 +08:00
parent a4a8739748
commit a1c86b3350
19 changed files with 43 additions and 40 deletions

View File

@ -87,18 +87,18 @@ func Get(ctx context.Context, storage driver.Driver, path string) (model.Obj, er
}
}
// is root folder
if r, ok := storage.GetAddition().(driver.IRootFolderId); ok && utils.PathEqual(path, "/") {
if r, ok := storage.GetAddition().(driver.IRootId); ok && utils.PathEqual(path, "/") {
return &model.Object{
ID: r.GetRootFolderId(),
ID: r.GetRootId(),
Name: "root",
Size: 0,
Modified: storage.GetStorage().Modified,
IsFolder: true,
}, nil
}
if r, ok := storage.GetAddition().(driver.IRootFolderPath); ok && isRoot(path, r.GetRootFolderPath()) {
if r, ok := storage.GetAddition().(driver.IRootPath); ok && isRoot(path, r.GetRootPath()) {
return &model.Object{
Path: r.GetRootFolderPath(),
Path: r.GetRootPath(),
Name: "root",
Size: 0,
Modified: storage.GetStorage().Modified,