Skip to content

Commit 7a5fddf

Browse files
committed
paused->stopped field rename in torrents/add route
1 parent e256d8d commit 7a5fddf

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The QBittorrent API exists, but is fragile...
3838
- does not return the same information in list/get endpoints (issue [#18188](https://github.com/qbittorrent/qBittorrent/issues/18188))
3939
- behaves unexpectedly with v2/hybrid hashes (issue [#18185](https://github.com/qbittorrent/qBittorrent/issues/18185))
4040
- [sometimes changes methods](https://github.com/qbittorrent/qBittorrent/issues/18097#issuecomment-1336194151) on endpoints without bumping the API version to a new major (semantic versioning)
41+
- may change form field names in API [without updating the docs](https://github.com/qbittorrent/qBittorrent/pull/20532)
4142

4243
Bittorrent v2 is only supported since v4.4.0 release (January 6th 2022).
4344

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
//! - does not return the same information in list/get endpoints (issue [#18188](https://github.com/qbittorrent/qBittorrent/issues/18188))
3838
//! - behaves unexpectedly with v2/hybrid hashes (issue [#18185](https://github.com/qbittorrent/qBittorrent/issues/18185))
3939
//! - [sometimes changes methods](https://github.com/qbittorrent/qBittorrent/issues/18097#issuecomment-1336194151) on endpoints without bumping the API version to a new major (semantic versioning)
40+
//! - may change form field names in API [without updating the docs](https://github.com/qbittorrent/qBittorrent/pull/20532)
4041
//!
4142
//! Bittorrent v2 is only supported since v4.4.0 release (January 6th 2022).
4243
//!

src/qbittorrent/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl<'a> ApiAdd<'a> for QBittorrentClient {
310310
}
311311

312312
if let Some(paused) = add.paused {
313-
form = form.text("paused", paused.to_string());
313+
form = form.text("stopped", paused.to_string());
314314
}
315315

316316
if let Some(tags) = add.tags {
@@ -330,7 +330,7 @@ impl<'a> ApiAdd<'a> for QBittorrentClient {
330330
}
331331

332332
if let Some(paused) = add.paused {
333-
form = form.text("paused", paused.to_string());
333+
form = form.text("stopped", paused.to_string());
334334
}
335335

336336
if let Some(tags) = add.tags {
@@ -368,7 +368,7 @@ impl<'a> ApiAdd<'a> for QBittorrentClient {
368368
.part("torrents", Part::bytes(file_bytes).file_name(file_name));
369369

370370
if let Some(paused) = add.paused {
371-
form = form.text("paused", paused.to_string());
371+
form = form.text("stopped", paused.to_string());
372372
}
373373

374374
if let Some(tags) = add.tags {

tests/qbittorrent.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ async fn magnet_v1() -> Result<(), ApiError> {
7070
assert_eq!(entry.hash.id().as_str(), V1_ID);
7171
assert_eq!(entry.name.as_str(), V1_NAME);
7272

73+
// Make sure torrent is paused
74+
assert_eq!(entry.state, "stoppedDL".to_string());
75+
7376
// Remove torrent
7477
api.remove(&target, true).await?;
7578

0 commit comments

Comments
 (0)