Page 1 of 1

sabnzbd queue API bug in quota and left_quota

Posted: April 10th, 2023, 12:18 am
by tagwolf
Both quota and left_quota have spaces after them when they show 0, and possibly other values in both json and xml in the queue api:

Version: 3.7.2

json

Code: Select all

quota: "0 "
left_quota: "0 "
xml

Code: Select all

<quota>0 </quota>
<left_quota>0 </left_quota>
This will cause many scripts and other things to treat these values as strings. If they are floats please output "0.0". Otherwise "0" would be correct. There might be other values with this issue too but these are the ones I noticed. Thanks!

Re: sabnzbd queue API bug in quota and left_quota

Posted: April 10th, 2023, 12:26 am
by sander
Can you find the cause in sabnzbd source code? And if so, maybe you can create a pull request on https://github.com/sabnzbd/sabnzbd/ with the corrected code?

Re: sabnzbd queue API bug in quota and left_quota

Posted: April 10th, 2023, 12:20 pm
by safihre
That's not a bug. That's been like that for ages and other tools came to rely on it.
I once tries to change things to int and float, and all the external tools broke.
So yeah, it's ugly, but it's just the way it's always been.