mirror of https://github.com/Xhofe/alist
commit
876579ea3b
|
@ -3,8 +3,6 @@ name: build_docker
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ v2 ]
|
branches: [ v2 ]
|
||||||
pull_request:
|
|
||||||
branches: [ v2 ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_docker:
|
build_docker:
|
||||||
|
|
|
@ -207,6 +207,9 @@ func GetAccountsByPath(path string) []Account {
|
||||||
if bIndex != -1 {
|
if bIndex != -1 {
|
||||||
name = name[:bIndex]
|
name = name[:bIndex]
|
||||||
}
|
}
|
||||||
|
if name == "/" {
|
||||||
|
name = ""
|
||||||
|
}
|
||||||
// 不是这个账号
|
// 不是这个账号
|
||||||
if path != name && !strings.HasPrefix(path, name+"/") {
|
if path != name && !strings.HasPrefix(path, name+"/") {
|
||||||
continue
|
continue
|
||||||
|
@ -253,6 +256,9 @@ func GetAccountFilesByPath(prefix string) []File {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
full := utils.ParsePath(v.Name)
|
full := utils.ParsePath(v.Name)
|
||||||
|
if len(full) <= len(prefix) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
// 不是以prefix为前缀
|
// 不是以prefix为前缀
|
||||||
if !strings.HasPrefix(full, prefix+"/") && prefix != "/" {
|
if !strings.HasPrefix(full, prefix+"/") && prefix != "/" {
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -38,6 +38,9 @@ func ParsePath(rawPath string) (*model.Account, string, base.Driver, error) {
|
||||||
if bIndex != -1 {
|
if bIndex != -1 {
|
||||||
name = name[:bIndex]
|
name = name[:bIndex]
|
||||||
}
|
}
|
||||||
|
if name == "/" {
|
||||||
|
name = ""
|
||||||
|
}
|
||||||
return &account, strings.TrimPrefix(rawPath, name), driver, nil
|
return &account, strings.TrimPrefix(rawPath, name), driver, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue