forked from TrueCloudLab/rclone
acd: filter out bogus children Amazon reports sometimes
This commit is contained in:
parent
718694d5ee
commit
2243b065e8
1 changed files with 11 additions and 0 deletions
|
@ -392,6 +392,17 @@ func (f *Fs) listAll(dirID string, title string, directoriesOnly bool, filesOnly
|
||||||
if *node.Status != statusAvailable {
|
if *node.Status != statusAvailable {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// Ignore bogus nodes Amazon Drive sometimes reports
|
||||||
|
hasValidParent := false
|
||||||
|
for _, parent := range node.Parents {
|
||||||
|
if parent == dirID {
|
||||||
|
hasValidParent = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !hasValidParent {
|
||||||
|
continue
|
||||||
|
}
|
||||||
// Store the nodes up in case we have to retry the listing
|
// Store the nodes up in case we have to retry the listing
|
||||||
out = append(out, node)
|
out = append(out, node)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue