-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BREAKING CHANGE] Implement group, sequentialDownload for torrent-set #94
Open
lv10wizard
wants to merge
18
commits into
j0rsa:main
Choose a base branch
from
lv10wizard:torrent-set
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
BREAKING CHANGE: The existing Torrent `_date` fields are now parsed into `DateTime<Utc>` from `i64`. Invalid or missing `_date` fields are parsed into `DateTime::UNIX_EPOCH`. The affected `Torrent` fields are: * activity_date * added_date * done_date * edit_date ----- This commit implements the remaining `torrent-get` fields through transmission version `4.1.0` (rpc-version-semver: `5.4.0`, rpc-version: `18`). Unless I missed something, the only missing fields should now be `files.beginPiece` and `files.endPiece`. * The `pieces` implementation adds a dependency on `base64` (https://docs.rs/base64/). * Exposes `IdleMode` and `RatioMode` enums which are the same but are defined as separate enums in transmission itself (libtransmission/transmission.h: `tr_idlelimit` and `tr_ratiolimit`). I've opted to mirror that here instead of combining them. * The unit tests are effectively tests against transmission rpc response deserialization. Notably, they do not test against a malformed response. * The unit tests for `availability` and `trackerList` are `#[ignore]`d because I don't have a way to get valid test data for them.
It's possible the type needs to be larger (i32 or maybe i64 even).
BREAKING CHANGE: Torrent.wanted type change from `Vec<i8>` to `Wanted` which is a simple wrapper around `Vec<bool>`. The `Wanted` type, like `Pieces` implements `Deref` resolving to `&Vec<_>`. * Adds a dependency on `serde_json` (which was solely a dev-dependency prior to this commit).
Users probably won't need to use or reference these types explicitly but exporting them makes the documentation link to their definitions which can be useful.
Adds `begin_piece` and `end_piece` to the Torrent files' subtype `File`. They are wrapped in `Option` because the fields are not present in transmission versions less than `4.1.0`. This should bring `torrent-get` up to the currently defined rpc spec (transmission 4.1.0, rpc-version: 18).
This splits out the types that users probably won't need to explicitly interact with into a separate export block 1) for documentation and 2) as a visual distinction.
* Adds feature flag documentation
Much appreciated for the change request. |
Also I believe this PR should be based on top of the previous one. So rebase would be needed once the other one is merged |
This offers an alternate way to construct TorrentSetArgs: ``` let args = TorrentSetArgs::default() .location("/foo/bar/baz") .labels(vec!["foo"]); ``` vs. (or similar) ``` let mut args = TorrentSetArgs::default(); args.location = Some("/foo/bar/baz"); args.location = Some(vec!["foo"]); ```
BREAKING CHANGE: Changes the types of various fields in TorrentSetArgs to mirror the types defined in [1] `transmission.h` (as of Aug 12, 2024: [2] dbea328). * Refactors IdleMode, RatioMode from response.rs -> request.rs * Fixes TorrentSetArgs setter extraneous allocations [1] https://github.com/transmission/transmission/blob/dbea32809ae7b75d52d236ebe1e6a4739d453349/libtransmission/transmission.h [2] transmission/transmission@dbea328
BREAKING CHANGE: This is a breaking change if users were referencing this field directly. This field is blindly overwritten by `RpcRequest::torrent_set` so it should not be exposed to users. Possibly a better solution would be to leave it exposed (so not a breaking change) and _somehow_ merge TorrentSetArgs.ids with the `ids` passed into `RpcRequest::torrent_set`, maybe something like: - `torrent_set(..., None)` overrides any TorrentSetArgs.ids - any ids defined in TorrentSetArgs are included into ids that are passed to `RpcRequest::torrent_set`. ... though, this could have unintended side effects somewhere.
* Removes the "(some)" distinction for "torrent-set" as the changes to TorrentSetArgs should bring the library up to date with the torrent-set definition. * Removes extraneous "Id" import * cargo fmt --all
lv10wizard
force-pushed
the
torrent-set
branch
from
October 12, 2024 18:45
00114ba
to
aa8ab8a
Compare
Rebased. This should now fast-forward from #92. (I thought I did this initially but I guess I messed up somewhere) |
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.
This PR implements
group
andsequentialDownload
onTorrentSetArgs
and should fully resolve #81 with the changes from #92.Breaking Change
Along with the breaking changes from #92 (from which these changes are based -- sorry if I'm supposed to base off of main), it also contains the following breaking changes:
Makes
TorrentSetArgs
'sids
field private. It is blindly overwritten inRpcRequest::torrent_set
. Exposing it to users only invites confusion (or worse: a hidden, hard to track-down bug) since any value they set will be unused.(click to expand) Changes the types of various
TorrentSetArgs
fields to mirror transmission.hi32
->usize
Vec<i32>
-><usize>
Vec<i32>
-><usize>
i64
->u16
Vec<i32>
-><usize>
Vec<i32>
-><usize>
Vec<i32>
-><usize>
i32
->usize
i32
->u16
(transmission.h definesvoid tr_torrentSetIdleLimit(tr_torrent* tor,
uint16_t
idle_minutes);
)i32
->IdleMode
enumf32
->f64
(transmission.h definesvoid tr_torrentSetRatioLimit(tr_torrent* tor,
double
desired_ratio);
)i32
->RatioMode
enumi32
->usize
Also in this PR
TorrentSetArgs
as an alternate way to construct it, eg: