Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: detect files using file size as well as md5 - fixes 980

Nick Craig-Wood28f9b9b611c9
diff --git a/drive/drive.go b/drive/drive.go
index 9f53094da..4f7de1ae6 100644
--- a/drive/drive.go
+++ b/drive/drive.go
@@ -479,8 +479,8 @@ func (f *Fs) ListDir(out fs.ListOpts, job dircache.ListDirJob) (jobs []dircache.
jobs = append(jobs, dircache.ListDirJob{DirID: item.Id, Path: remote + "/", Depth: job.Depth - 1})
}
}
- case item.Md5Checksum != "":
- // If item has MD5 sum it is a file stored on drive
+ case item.Md5Checksum != "" || item.FileSize > 0:
+ // If item has MD5 sum or a length it is a file stored on drive
o, err := f.newObjectWithInfo(remote, item)
if err != nil {
out.SetError(err)