mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 12:05:05 +08:00
onedrive: fix disk usage for sharepoint
Some onedrive sharepoints appear to return all 0s for quota "quota":{"deleted":0,"remaining":0,"total":0,"used":0} This commit detects this and returns unknown for all quota parts. See: https://forum.rclone.org/t/zero-size-volume-when-mounting-onedrive-sharepoint/19597
This commit is contained in:
parent
664213cedb
commit
0906f8dd3b
|
@ -1247,6 +1247,10 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) {
|
|||
return nil, errors.Wrap(err, "about failed")
|
||||
}
|
||||
q := drive.Quota
|
||||
// On (some?) Onedrive sharepoints these are all 0 so return unknown in that case
|
||||
if q.Total == 0 && q.Used == 0 && q.Deleted == 0 && q.Remaining == 0 {
|
||||
return &fs.Usage{}, nil
|
||||
}
|
||||
usage = &fs.Usage{
|
||||
Total: fs.NewUsageValue(q.Total), // quota of bytes that can be used
|
||||
Used: fs.NewUsageValue(q.Used), // bytes in use
|
||||
|
|
Loading…
Reference in New Issue
Block a user