forked from TrueCloudLab/rclone
drive: improve ChangeNotify support for items with multiple parents
This commit is contained in:
parent
8ec55ae20b
commit
f8c2689e77
1 changed files with 7 additions and 5 deletions
|
@ -2199,11 +2199,13 @@ func (f *Fs) changeNotifyRunner(notifyFunc func(string, fs.EntryType), startPage
|
||||||
|
|
||||||
// translate the parent dir of this object
|
// translate the parent dir of this object
|
||||||
if len(change.File.Parents) > 0 {
|
if len(change.File.Parents) > 0 {
|
||||||
if parentPath, ok := f.dirCache.GetInv(change.File.Parents[0]); ok {
|
for _, parent := range change.File.Parents {
|
||||||
// and append the drive file name to compute the full file name
|
if parentPath, ok := f.dirCache.GetInv(parent); ok {
|
||||||
newPath := path.Join(parentPath, change.File.Name)
|
// and append the drive file name to compute the full file name
|
||||||
// this will now clear the actual file too
|
newPath := path.Join(parentPath, change.File.Name)
|
||||||
pathsToClear = append(pathsToClear, entryType{path: newPath, entryType: changeType})
|
// this will now clear the actual file too
|
||||||
|
pathsToClear = append(pathsToClear, entryType{path: newPath, entryType: changeType})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else { // a true root object that is changed
|
} else { // a true root object that is changed
|
||||||
pathsToClear = append(pathsToClear, entryType{path: change.File.Name, entryType: changeType})
|
pathsToClear = append(pathsToClear, entryType{path: change.File.Name, entryType: changeType})
|
||||||
|
|
Loading…
Add table
Reference in a new issue