From 25bbc5d22b4e9c89ce40d5a3d7d2dfba0bb48640 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 20 Feb 2018 14:33:52 +0000 Subject: [PATCH] drive: make --drive-auth-owner-only look in all directories Previously it was ignoring directories which weren't owned by the user which meant it was ignoring files owned by the user in those directories. --- backend/drive/drive.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index e3f9c571e..b393ffccb 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -712,14 +712,14 @@ func (f *Fs) List(dir string) (entries fs.DirEntries, err error) { _, err = f.list(directoryID, "", false, false, false, func(item *drive.File) bool { remote := path.Join(dir, item.Name) switch { - case *driveAuthOwnerOnly && !isAuthOwned(item): - // ignore object or directory case item.MimeType == driveFolderType: // cache the directory ID for later lookups f.dirCache.Put(remote, item.Id) when, _ := time.Parse(timeFormatIn, item.ModifiedTime) d := fs.NewDir(remote, when).SetID(item.Id) entries = append(entries, d) + case *driveAuthOwnerOnly && !isAuthOwned(item): + // ignore object case item.Md5Checksum != "" || item.Size > 0: // If item has MD5 sum or a length it is a file stored on drive o, err := f.newObjectWithInfo(remote, item)