Repository navigation
fix: qBittorrent uses the RMAB category's save path in Manual mode - #467
Merged
Merged
Conversation
…egory save path applies (#326) Adds sent the readmeabook category without a savepath and without autoTMM, so with qBittorrent's default Torrent Management Mode set to Manual the torrent went to the global default folder and the import failed. Both add paths now send autoTMM=true and still no savepath. When ensureCategory() fails, the category's path is unknown, so the add sends autoTMM=false with the resolved (remote-mapped) download folder as savepath. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.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.
Closes #326
What changed
src/lib/integrations/qbittorrent.service.ts: both add paths (magnet link and .torrent file) now sendautoTMM=truealong with thereadmeabookcategory, and still nosavepath. The newplacementFields()holds the rule and the reason.ensureCategory()fails (it now returnsfalseinstead of only logging), the category may be missing or have no save path. The add then sendsautoTMM=falsewithsavepathset to the resolved download folder (download_dirplus the client'scustomPath, with remote path mapping applied), so the files still land where RMAB imports from.tests/helpers/fake-qbittorrent.ts: records the text fields of multipart adds (it already recorded form-encoded ones) and can make/torrents/categoriesfail. It never validated fields, so the extra one needed no change; the e2e fake (e2e/fake-arr/src/qbit.js) ignores unknown fields too.documentation/phase3/download-clients.md(qBittorrent line under the resolved download path) anddocumentation/phase3/qbittorrent.md(Category Management line, Fixed Issues fix: Install all dependencies for build, then prune dev deps #20).Why
RMAB creates the
readmeabookcategory with the right save path and leavessavepathoff each add so the category decides. But an add withoutautoTMMtakes qBittorrent's default Torrent Management Mode, and in Manual mode the category's save path is ignored. Torrents then went to qBittorrent's global default folder and the import failed.Leaving
savepathoff still matters: in Automatic mode qBittorrent keeps using its "incomplete downloads" folder for the category.For the fallback: if the category could not be created or checked, Automatic mode would put the files in qBittorrent's default folder plus the category name, which is not RMAB's folder. An explicit save path in Manual mode is the only placement RMAB can be sure of there.
autoTMMon/torrents/addarrived in qBittorrent Web API 2.2.0, first released in qBittorrent 4.1.5. qBittorrent 4.1.0 to 4.1.4 ignore the field, so they behave as they do today.Evidence
tests/integrations/qbittorrent-auto-tmm.test.tsruns the real service against the fake qBittorrent over HTTP, for a magnet link and a .torrent file: the add carriescategory=readmeabookandautoTMM=truewith nosavepath; with/torrents/categoriesfailing it carriesautoTMM=falseandsavepathset to the download folder, and to the remote-mapped folder when path mapping is on.tests/integrations/qbittorrent.service.test.ts:ensureCategory()resolvesfalsewhen it fails; the add tests that stub it now stub success (true).main'sqbittorrent.service.ts(8ee4a84) and this branch's tests: 7 failed, 84 passed, all on an assertion (the six add requests have noautoTMMorsavepath;ensureCategory()resolvesundefined). On this branch: 91/91 pass.Checks
vitest relatedonqbittorrent.service.ts, plus the new test file): PASS, 107 files, 1657/1657.vitest relatedon the fake helper: PASS, 5 files, 106/106tsc --noEmitclean; ESLint reports nothing new in the 4 touched code and test files compared withmain)src/liband tests onlymain(dad0daf):vitest relatedon the source changed on both sides: PASS, 129 files, 2680/2680;tsc --noEmitcleanRisk and rollback
download_dir,customPathor path mapping, which RMAB syncs on the next add), qBittorrent may move existingreadmeabooktorrents to the new path ("When Category Save Path changed"; qBittorrent's default switches them to Manual mode instead).deleteDownload(id, true)), which knows the new location.ensureCategory()fails. Before, those adds sent no save path and took qBittorrent's default; now they name RMAB's download folder in Manual mode. qBittorrent-compatible clients whose category calls fail now get an explicitsavepathtoo.Release note
🤖 Generated with Claude Code