Skip to content

Commit a0fcfa3

Browse files
authored
fix(aliyundrive_open): use safe disk usage calculation (#1510)
1 parent 15f2765 commit a0fcfa3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/aliyundrive_open/driver.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,7 @@ func (d *AliyundriveOpen) GetDetails(ctx context.Context) (*model.StorageDetails
299299
total := utils.Json.Get(res, "personal_space_info", "total_size").ToUint64()
300300
used := utils.Json.Get(res, "personal_space_info", "used_size").ToUint64()
301301
return &model.StorageDetails{
302-
DiskUsage: model.DiskUsage{
303-
TotalSpace: total,
304-
FreeSpace: total - used,
305-
},
302+
DiskUsage: driver.DiskUsageFromUsedAndTotal(used, total),
306303
}, nil
307304
}
308305

0 commit comments

Comments
 (0)