fix: correct SABnzbd priority numeric mapping - #78
Closed
thedancingdeveloper wants to merge 2 commits into
Closed
Conversation
sab_priority_to_priority mapped 0/1/2/-100/3 to Low/Normal/High/Force, shifted by one from SABnzbd's real numeric codes (constants.py: Low=-1, Normal=0, High=1, Force=2, Default=-100, Repair=3) and contradicting sab_priority_matches, which already used the correct table for queue filtering. Any client setting priority via addfile/addurl/priority-change got the wrong priority applied.
4 tasks
# Conflicts: # crates/nzb-web/src/sabnzbd_compat.rs
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #71:
sab_priority_to_prioritymapped SABnzbd's numeric priority codes off by one (0→Low, 1→Normal, 2→High, "-100"/"3"→Force), contradictingsab_priority_matchesin the same file, which already used the correct table (Low=-1, Normal=0, High=1, Force=2) for queue filtering.Verified against
sabnzbd/sabnzbd@5.1.xsabnzbd/constants.py:120-127:Fix
sab_priority_to_prioritynow uses the same numeric table assab_priority_matches.-100(SABnzbd's "use category default") and3(Repair, which we have no separate concept for) map to Normal and Force respectively, matching how real SABnzbd displays/treats them.Test plan
cargo test -p nzb-web— addedsab_priority_to_priority_matches_upstream_numeric_codesandsab_priority_to_priority_agrees_with_sab_priority_matches(the latter guards against the two tables silently diverging again).cargo clippy -p nzb-web --all-targets— clean.nzb-webtest suite passes.🤖 Generated with Claude Code