mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 19:37:41 +08:00
fix(aliyundrive_open): use safe disk usage calculation (#1510)
This commit is contained in:
@@ -299,10 +299,7 @@ func (d *AliyundriveOpen) GetDetails(ctx context.Context) (*model.StorageDetails
|
|||||||
total := utils.Json.Get(res, "personal_space_info", "total_size").ToUint64()
|
total := utils.Json.Get(res, "personal_space_info", "total_size").ToUint64()
|
||||||
used := utils.Json.Get(res, "personal_space_info", "used_size").ToUint64()
|
used := utils.Json.Get(res, "personal_space_info", "used_size").ToUint64()
|
||||||
return &model.StorageDetails{
|
return &model.StorageDetails{
|
||||||
DiskUsage: model.DiskUsage{
|
DiskUsage: driver.DiskUsageFromUsedAndTotal(used, total),
|
||||||
TotalSpace: total,
|
|
||||||
FreeSpace: total - used,
|
|
||||||
},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user