lib/db, lib/model: Keep need stats in metadata (ref #5899) (#6413)

This commit is contained in:
Simon Frei
2020-05-11 15:07:06 +02:00
committed by GitHub
parent 7dc290c3ed
commit a94951becd
21 changed files with 971 additions and 358 deletions
+2 -17
View File
@@ -314,23 +314,8 @@ func (s *Snapshot) GlobalSize() Counts {
return global.Add(recvOnlyChanged)
}
func (s *Snapshot) NeedSize() Counts {
var result Counts
s.WithNeedTruncated(protocol.LocalDeviceID, func(f FileIntf) bool {
switch {
case f.IsDeleted():
result.Deleted++
case f.IsDirectory():
result.Directories++
case f.IsSymlink():
result.Symlinks++
default:
result.Files++
result.Bytes += f.FileSize()
}
return true
})
return result
func (s *Snapshot) NeedSize(device protocol.DeviceID) Counts {
return s.meta.Counts(device, needFlag)
}
// LocalChangedFiles returns a paginated list of files that were changed locally.