sabnzbd queue API bug in quota and left_quota

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
tagwolf
Newbie
Newbie
Posts: 10
Joined: April 8th, 2023, 11:56 pm

sabnzbd queue API bug in quota and left_quota

Post 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!
User avatar
sander
Release Testers
Release Testers
Posts: 8827
Joined: January 22nd, 2008, 2:22 pm

Re: sabnzbd queue API bug in quota and left_quota

Post 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?
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: sabnzbd queue API bug in quota and left_quota

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply