From d0e68480be008691be4bbda1a917b269238d501b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Dec 2023 11:47:20 +0000 Subject: [PATCH] dropbox: fix used space on dropbox team accounts Before this change we were not using the used space from the team stats. This patch uses that as the used space if available as it seems to include the user stats in it. See: https://forum.rclone.org/t/rclone-about-with-dropbox-reporte-size-incorrectly/43269/ --- backend/dropbox/dropbox.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/dropbox/dropbox.go b/backend/dropbox/dropbox.go index 1b647af08..0eea08c53 100644 --- a/backend/dropbox/dropbox.go +++ b/backend/dropbox/dropbox.go @@ -1231,18 +1231,21 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { return nil, err } var total uint64 + var used = q.Used if q.Allocation != nil { if q.Allocation.Individual != nil { total += q.Allocation.Individual.Allocated } if q.Allocation.Team != nil { total += q.Allocation.Team.Allocated + // Override used with Team.Used as this includes q.Used already + used = q.Allocation.Team.Used } } usage = &fs.Usage{ - Total: fs.NewUsageValue(int64(total)), // quota of bytes that can be used - Used: fs.NewUsageValue(int64(q.Used)), // bytes in use - Free: fs.NewUsageValue(int64(total - q.Used)), // bytes which can be uploaded before reaching the quota + Total: fs.NewUsageValue(int64(total)), // quota of bytes that can be used + Used: fs.NewUsageValue(int64(used)), // bytes in use + Free: fs.NewUsageValue(int64(total - used)), // bytes which can be uploaded before reaching the quota } return usage, nil }