对于我的应用程序,我需要计算每个用户的可用存储空间。我使用关于 API(https://developers.google.com/drive/v2/reference/about/get)和以下公式:
Free storage = (quotaBytesTotal - quotaBytesUsed)
它运行良好,除了没有额外存储的用户。对于此类用户,quotaBytesUsed 大于quotaBytesTotal:
{"kind"=>"drive#user", "displayName"=>"D B", "isAuthenticatedUser"=>true},
"quotaBytesTotal"=>"5368709120",
"quotaBytesUsed"=>"26843545600",
"quotaBytesUsedAggregate"=>"26843545600",
"quotaBytesUsedInTrash"=>"0",
"largestChangeId"=>"363004",
这是 API 错误吗?如何计算此类用户的免费存储空间?