Problem
Fixes #1047. A completed audiobook downloaded through rdt-client (qBittorrent-compatible API, reported as v4.3.2) sits at UNKNOWN / 100% forever and is never imported.
qBittorrent 5.0 renamed the paused torrent states from pausedDL/pausedUP to stoppedDL/stoppedUP, and QbittorrentResponseMapper only recognizes the new names. rdt-client and any qBittorrent older than 5.0 still report pausedUP for a finished torrent. That state:
- isn't in either status switch, so it falls through to
Warning/"unknown", and - isn't in the completed-at-100% checks, so even at
progress = 1.0it never becomesCompleted.
So the download never reaches a state that triggers import.
Fix
Treat pausedDL/pausedUP as aliases of stoppedDL/stoppedUP in both status mappers (MapDownloadItemStatus, MapQueueStatus) and in both completed-at-100% checks. No other behavior changes; the 5.x stopped* names keep working.
Tests
In QbittorrentAdapterTests:
- Extended the existing
CompletedTorrentStates_MapToCompletedtheory withpausedUP(maps toCompleted/"completed"at 100%). - Added
LegacyPausedStates_MapToPaused_WhenIncompleteforpausedDL/pausedUPat partial progress (maps toPaused/"paused").
All pass; format:backend:check is clean.
🤖 Generated with Claude Code
Automated Canary build