Skip to content

Commit 097b516

Browse files
committed
fix: wrong virtual file name
1 parent b73dbee commit 097b516

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

internal/operations/account.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,20 @@ func GetAccountVirtualFilesByPath(prefix string) []driver.FileInfo {
148148
prefix = utils.StandardizationPath(prefix)
149149
set := make(map[string]interface{})
150150
for _, v := range accounts {
151+
// TODO should save a balanced account
151152
// balance account
152153
if utils.IsBalance(v.GetAccount().VirtualPath) {
153154
continue
154155
}
155-
full := v.GetAccount().VirtualPath
156-
if len(full) <= len(prefix) {
156+
virtualPath := v.GetAccount().VirtualPath
157+
if len(virtualPath) <= len(prefix) {
157158
continue
158159
}
159160
// not prefixed with `prefix`
160-
if !strings.HasPrefix(full, prefix+"/") && prefix != "/" {
161+
if !strings.HasPrefix(virtualPath, prefix+"/") && prefix != "/" {
161162
continue
162163
}
163-
name := strings.Split(strings.TrimPrefix(full, prefix), "/")[0]
164+
name := strings.Split(strings.TrimPrefix(virtualPath, prefix), "/")[1]
164165
if _, ok := set[name]; ok {
165166
continue
166167
}

0 commit comments

Comments
 (0)