Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quota/left_quota missing suffix #2590

Open
thezoggy opened this issue Jun 12, 2023 · 1 comment
Open

quota/left_quota missing suffix #2590

thezoggy opened this issue Jun 12, 2023 · 1 comment
Labels

Comments

@thezoggy
Copy link
Contributor

user on discord called out inconsistent on how sab reports sizing.. sometimes single letter suffix sometimes two letter, example:

"cache_size":"30.8 MB"
"left_quota":"-14.6 G"
"cache_size":"30.8 MB"

I see there are various ones where we do single letter or multiple letter.. usually if we want to show Bytes as lowest value.

for cache size we pass a post suffix to append:

    header["cache_size"] = to_units(anfo.cache_size, "B")

for quota/left_quota we do not...

    header["quota"] = to_units(sabnzbd.BPSMeter.quota)
    header["left_quota"] = to_units(sabnzbd.BPSMeter.left)

Testing on latest dev which I have no quota, I do see queue result shows:

    "quota": "0 ",
    "have_quota": false,
    "left_quota": "0 ",

Looked back at git history, looks like the quota stuff has always been a single letter prefix.. so yeah we should prob fix that up as "0 B" would be better for apps to handle than the lack of suffix.

Also I see our speed one is also missing suffix...

    "speed": "0 ",

But uncertain if that would break things if we 'fixed' that one.

@Safihre
Copy link
Member

Safihre commented Jun 21, 2023

Yeah it's true, it's a mess. Relic from the times when we made our interface fully in Cheetah..
We should just use int everywhere and let the browser/client figure out the notation. But that just breaks stuff for others.

@github-actions github-actions bot added the Stale Issues automatically closed because they became stale label Jul 13, 2023
@Safihre Safihre added Bug and removed Stale Issues automatically closed because they became stale labels Jul 13, 2023
@sabnzbd sabnzbd deleted a comment from github-actions bot Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants