diff --git a/backend/pcloud/pcloud.go b/backend/pcloud/pcloud.go index 82f9f42f5..cb470599c 100644 --- a/backend/pcloud/pcloud.go +++ b/backend/pcloud/pcloud.go @@ -908,10 +908,14 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { if err != nil { return nil, err } + free := q.Quota - q.UsedQuota + if free < 0 { + free = 0 + } usage = &fs.Usage{ - Total: fs.NewUsageValue(q.Quota), // quota of bytes that can be used - Used: fs.NewUsageValue(q.UsedQuota), // bytes in use - Free: fs.NewUsageValue(q.Quota - q.UsedQuota), // bytes which can be uploaded before reaching the quota + Total: fs.NewUsageValue(q.Quota), // quota of bytes that can be used + Used: fs.NewUsageValue(q.UsedQuota), // bytes in use + Free: fs.NewUsageValue(free), // bytes which can be uploaded before reaching the quota } return usage, nil }