Closed leonardoacoelho closed 1 year ago
@leonardoacoelho It looks not true. I checked json response:
"upload_quota": {
"space": {
"free": 518777128,
"max": 524288000,
"used": 5510872,
"showing": "periodic",
"unit": "video_size"
},
"periodic": {
"period": "week",
"unit": "video_size",
"free": 518777128,
"max": 524288000,
"used": 5510872,
"reset_date": "2023-04-13T00:00:00-04:00"
},
"lifetime": {
"unit": "video_size",
"free": 5363198248,
"max": 5368709120,
"used": 5510872
}
},
It has unit video size. Could you add example of your JSON response?
Hi, I got the exact same issue but with a paid account. The free space value returned by Vimeo API is also the number of videos left in the quota. I confirm that Leonardo solution solves the issue.
@mfilippov True, if paid account space refers to storage size if the free account space refers to the video count the person can upload in that month.
@ferozhussain than you for the information I think we need to handle both cases. Could you provide which kind of unit in response on free account in paid it ("unit": "video_size")
I found it.
"space": {
"free": 0,
"max": 2,
"used": 2,
"showing": "periodic",
"unit": "video_count"
},
I made proper fix for this issue in #199.
Free space is not measured in bytes but in video quantity, so it must be checked if there is at least one free space to use instead of checking if file lenght is bigger than the free space.