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: 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 }