fix(qbittorrent): send the four Advanced Settings to the client - #926
Open
m4bard wants to merge 1 commit into
Open
fix(qbittorrent): send the four Advanced Settings to the client#926m4bard wants to merge 1 commit into
m4bard wants to merge 1 commit into
Conversation
Initial State, Sequential Order, First and Last First and Content Layout saved and reloaded correctly and reached qBittorrent in no form at all. QbittorrentTorrentAddPlan had no field for any of them, so there was no route from the settings blob to the add request. The plan carries them now and the content builder emits them on both the file and the magnet path. I ran a throwaway qBittorrent 5.2.3, Web API 2.15.1, and checked each parameter by adding a torrent with it and reading the state back, because two of them cannot be got right from the documentation. "paused" has been ignored since Web API 2.11, where it became "stopped". A build implementing this from the older docs would have produced a setting that still did nothing, in a section where nothing worked, which is a bad way to find out. Both names are sent. 4.x reads "paused" and ignores "stopped"; 5.x does the reverse. That is cheaper and less brittle than asking the client its version. "contentLayout" is case sensitive. The stored values are lowercase, so passing them straight through leaves the torrent on its default layout with no error. They are mapped to Original, Subfolder and NoSubfolder. Force start is not accepted on the add call. Sending it there succeeds and does nothing. The workflow makes a setForceStart call after the add instead, and only warns if that fails, since the torrent is already added and losing a good download over an optional priority tweak would be worse. Only options the user chose are sent, so Default still means the client's own preference rather than this code's idea of one. Controls: dropping the options entirely fails five of the ten tests, passing contentLayout through unchanged fails three, and sending only "paused" fails one. Verified again end to end against the live instance with all four set together: state stoppedDL, seq_dl true, f_l_piece_prio true, and the folder stripped. 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 #898.
Initial State, Sequential Order, First and Last First and Content Layout saved and reloaded correctly and reached qBittorrent in no form at all.
QbittorrentTorrentAddPlanhad no field for any of them, so there was no route from the settings blob to the add request. The plan carries them now and the content builder emits them on both the file and the magnet path.I checked these against a running client rather than the docs
I ran a throwaway qBittorrent 5.2.3, Web API 2.15.1, added a torrent with each parameter and read the state back. Two of the four cannot be got right from documentation alone.
pausedhas been ignored since Web API 2.11, where it becamestopped. A build implementing this from the older docs would have produced a setting that still did nothing, in a section where nothing worked, which is a bad way to find out. Both names are sent: 4.x readspausedand ignoresstopped, and 5.x does the reverse. That is cheaper and less brittle than asking the client its version first.contentLayoutis case sensitive. The stored values are lowercase, so passing them straight through leaves the torrent on its default layout with no error at all. They are mapped toOriginal,SubfolderandNoSubfolder.Force start is not accepted on the add call at all. Sending it there succeeds and does nothing. The workflow makes a
setForceStartcall after the add instead, and only warns if that one fails, because the torrent is already added by then and losing a good download over an optional priority tweak would be the worse outcome.Only options the user chose are sent, so Default still means the client's own preference rather than this code's idea of one.
Tests
Ten, including the case where nothing is configured, so the parameters cannot quietly become always-present.
Dropping the options entirely fails five of the ten. Passing
contentLayoutthrough unchanged fails three. Sending onlypausedfails one.Verified again end to end with all four set together against the live instance: state
stoppedDL,seq_dltrue,f_l_piece_priotrue, and the folder stripped.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.