fix(downloads): SABnzbd category filter hid tracked jobs reassigned to Default, stranding them unimported#759
Open
t3chnaztea wants to merge 1 commit into
Conversation
…o Default, stranding them unimported; warn when category missing
SABnzbd silently reassigns jobs with an unknown category to Default (*), but
every SABnzbd read mapper filtered slots by the configured category before
matching nzo_id, so a job Listenarr itself grabbed became invisible ("tracked
but 0 in client") and never imported. The queue/history mappers now bypass the
category filter for any slot whose nzo_id is in the monitored set, reconciling
grabbed items by download ID while category filtering still scopes untracked
discovery. The connection tester also probes mode=get_cats and returns an
advisory (not a hard failure) when the configured category is absent from
SABnzbd, so misconfiguration surfaces before jobs strand.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The bug
SABnzbd silently reassigns jobs with unknown categories to Default (
*). Listenarr sendscat=<configured>on add, but every read mapper filtered slots by configured category before matchingnzo_id(SabnzbdResponseMapper.MapQueueSlotToQueueItem/MapHistorySlotToQueueItem). So when the configured category doesn't exist in SABnzbd, a job Listenarr itself grabbed becomes invisible to it: the monitor reconciles by nzo_id but never sees the slot, the download shows "1 tracked but 0 in client", and it never progresses or imports. Notably the history endpoint is already fetched unfiltered — the recovery data was in hand and discarded client-side.The fix
Two parts, mirroring how Radarr treats categories (reconcile items you grabbed by download ID; category scopes discovery, not tracked items):
MapQueueSlotToDownloadClientItemis deliberately untouched: the item-fetch path has no monitored set and isn't the strand path.)mode=get_catsand, if the configured category is absent, returns an advisory ("category 'x' does not exist in SABnzbd. Jobs will fall into Default and may not import. Create the category…") — still a passing test, and the probe is best-effort (any get_cats failure degrades to a clean pass).Tests
QueueSlot_InDifferentCategory_ButTracked_IsReturned/HistorySlot_InDifferentCategory_ButTracked_IsReturnedQueueSlot_InDifferentCategory_NotTracked_IsFiltered/HistorySlot_InDifferentCategory_NotTracked_IsFiltered(discovery filtering preserved)TestConnectionAsync_CategoryMissingFromSabnzbd_ReturnsAdvisoryPass/TestConnectionAsync_CategoryPresentInSabnzbd_ReturnsCleanPassSabnzbd_GetQueueAndItems_FilterByConfiguredCategorypassed both nzo_ids as tracked yet asserted the foreign-category one was hidden — it encoded exactly this bug. Its intent (respect configured category) is a discovery concern, so it now exercises the no-tracked-ids path and keeps its assertions.Full suite green: 1195 passed / 0 failed;
dotnet format --verify-no-changesclean.🤖 Generated with Claude Code