mirror of https://github.com/Xhofe/alist
commit
876579ea3b
|
@ -3,8 +3,6 @@ name: build_docker
|
|||
on:
|
||||
push:
|
||||
branches: [ v2 ]
|
||||
pull_request:
|
||||
branches: [ v2 ]
|
||||
|
||||
jobs:
|
||||
build_docker:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue