mirror of https://github.com/Xhofe/alist
fix: wrong virtual file name
parent
b73dbee7e6
commit
097b516dc5
|
@ -148,19 +148,20 @@ func GetAccountVirtualFilesByPath(prefix string) []driver.FileInfo {
|
||||||
prefix = utils.StandardizationPath(prefix)
|
prefix = utils.StandardizationPath(prefix)
|
||||||
set := make(map[string]interface{})
|
set := make(map[string]interface{})
|
||||||
for _, v := range accounts {
|
for _, v := range accounts {
|
||||||
|
// TODO should save a balanced account
|
||||||
// balance account
|
// balance account
|
||||||
if utils.IsBalance(v.GetAccount().VirtualPath) {
|
if utils.IsBalance(v.GetAccount().VirtualPath) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
full := v.GetAccount().VirtualPath
|
virtualPath := v.GetAccount().VirtualPath
|
||||||
if len(full) <= len(prefix) {
|
if len(virtualPath) <= len(prefix) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// not prefixed with `prefix`
|
// not prefixed with `prefix`
|
||||||
if !strings.HasPrefix(full, prefix+"/") && prefix != "/" {
|
if !strings.HasPrefix(virtualPath, prefix+"/") && prefix != "/" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
name := strings.Split(strings.TrimPrefix(full, prefix), "/")[0]
|
name := strings.Split(strings.TrimPrefix(virtualPath, prefix), "/")[1]
|
||||||
if _, ok := set[name]; ok {
|
if _, ok := set[name]; ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue