From 9daeaf75626587fde53c1f8c94a056da2478f373 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Fri, 1 Apr 2022 09:40:08 +0800 Subject: [PATCH 1/2] fix: virtual path, support mount to root path --- model/account.go | 6 ++++++ server/common/common.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/model/account.go b/model/account.go index ffa66a47..e14be95a 100644 --- a/model/account.go +++ b/model/account.go @@ -207,6 +207,9 @@ func GetAccountsByPath(path string) []Account { if bIndex != -1 { name = name[:bIndex] } + if name == "/" { + name = "" + } // 不是这个账号 if path != name && !strings.HasPrefix(path, name+"/") { continue @@ -253,6 +256,9 @@ func GetAccountFilesByPath(prefix string) []File { continue } full := utils.ParsePath(v.Name) + if len(full) <= len(prefix) { + continue + } // 不是以prefix为前缀 if !strings.HasPrefix(full, prefix+"/") && prefix != "/" { continue diff --git a/server/common/common.go b/server/common/common.go index e829a9ae..cbebf57c 100644 --- a/server/common/common.go +++ b/server/common/common.go @@ -38,6 +38,9 @@ func ParsePath(rawPath string) (*model.Account, string, base.Driver, error) { if bIndex != -1 { name = name[:bIndex] } + if name == "/" { + name = "" + } return &account, strings.TrimPrefix(rawPath, name), driver, nil } From e83081380ec7fe7ed2d0d747a2896b412deb6326 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Fri, 1 Apr 2022 09:40:53 +0800 Subject: [PATCH 2/2] workflow: cancel build docker for pr --- .github/workflows/build_docker.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 24f36b3d..5b3db5cb 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -3,8 +3,6 @@ name: build_docker on: push: branches: [ v2 ] - pull_request: - branches: [ v2 ] jobs: build_docker: