fix(download-clients): make the Priority dropdown speak the planners' vocabulary - #922
Open
m4bard wants to merge 1 commit into
Open
fix(download-clients): make the Priority dropdown speak the planners' vocabulary#922m4bard wants to merge 1 commit into
m4bard wants to merge 1 commit into
Conversation
… vocabulary The Priority select offered Default, Last and First. NzbgetRequestPlanner and SabnzbdAddRequestPlanner switch on force, high, normal and low, with a fallback of zero. The two sets do not intersect, so every choice other than Default fell through to normal and the control did nothing. The one existing backend test for this passes "high", a value the form could never send. The select now offers Default, Low, Normal, High and Force. Older Priority is gone. It had no backend reference at all, and the split it came from is Sonarr's recently-aired versus back-catalogue distinction, which has no analogue here. The help text said so out loud: "episodes that aired within the last 14 days". One Priority control replaces the pair, bound to the recentPriority key the planners already read, so no stored setting changes meaning. If you do want two, say so and I will put it back with the second one wired. Remove Completed (Legacy) and Remove Failed (Legacy) are gone too. Neither had any backend reference, and the Completed Download Action dropdown directly above them already covers removing from the client and deleting the files. They were labelled Legacy because that dropdown replaced them. Also, SABnzbd's BuildFileQueryParams always set priority, including for Default, where it sent 0. That overrides whatever the SABnzbd category carries, which is not what Default asks for. BuildQueryParams above it already skipped the parameter; the path AddAsync actually uses did not. It does now. The Priority section is gated on usenet, since only the usenet planners read it. The form test and DownloadClientPriorityTests pin the same five strings from both ends, which is the check that was missing. Confirmed by putting Last and First back, which fails the form test, and by making the SABnzbd path send a priority unconditionally again, which fails the Default case. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEVQ7qDJLk5196MFeggWuA
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.
Fixes #900.
The Priority select offered Default, Last and First.
NzbgetRequestPlannerandSabnzbdAddRequestPlannerswitch onforce,high,normalandlow, with a fallback of zero. The two sets do not intersect, so every choice other than Default fell through to normal and the control did nothing. The one existing backend test for this passes"high", a value the form could never send.The select now offers Default, Low, Normal, High and Force.
Older Priority is gone
It had no backend reference at all, and the split it came from is Sonarr's recently-aired versus back-catalogue distinction, which has no analogue here. The help text said so out loud: "Priority to use when grabbing episodes that aired within the last 14 days".
One Priority control replaces the pair, bound to the
recentPrioritykey the planners already read, so no stored setting changes meaning.If you do want two, say so and I will put it back with the second one wired.
The two Legacy checkboxes are gone
Remove Completed (Legacy) and Remove Failed (Legacy) had no backend reference either, and the Completed Download Action dropdown directly above them already covers removing from the client and deleting the files. They were labelled Legacy because that dropdown replaced them.
One more thing while I was in there
SABnzbd's
BuildFileQueryParamsalways setpriority, including for Default, where it sent0. That overrides whatever priority the SABnzbd category carries, which is not what Default asks for.BuildQueryParamsabove it already skipped the parameter; the pathAddAsyncactually uses did not. It does now.The Priority section is gated on usenet, since only the usenet planners read it.
Tests
The form test and
DownloadClientPriorityTestspin the same five strings from both ends, which is the check that was missing. A backend test alone could not have caught this, because the backend was always correct about the vocabulary it accepted.Confirmed by putting Last and First back, which fails the form test, and by making the SABnzbd path send a priority unconditionally again, which fails the Default case.
Worked through with Claude Code at my direction. The claims above were checked by running them rather than by reading, and I reviewed this before posting.