acd: filter out bogus children Amazon reports sometimes

This commit is contained in:
Stefan Breunig
2016-11-11 18:05:24 +00:00
committed by Nick Craig-Wood
parent 718694d5ee
commit 2243b065e8
+11
View File
@@ -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)
} }