Skip to content

Commit 6d01044

Browse files
authored
feat: Update Torrent model with missing API fields (#34)
* added missing fields in torrent model * Updated readme to mention supporting newer version of qbit
1 parent 76c2a86 commit 6d01044

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
A Rust library for interacting with qBittorrent's Web API.
88

99
Implemented according to [WebUI API (qBittorrent 4.1)](https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)).
10+
Since the official documentation often lags behind releases, this crate also includes support for newer, undocumented features to stay current. The implementation is based on the API behavior of qBittorrent v5.1.2.
11+
For the most accurate and complete list of supported API methods and model fields, please refer to this [crate's documentation on docs.rs](https://docs.rs/qbit-rs/latest/qbit_rs/).
1012

1113
## Usage
1214

src/model/torrent.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub struct Torrent {
3535
/// Category of the torrent
3636
pub category: Option<String>,
3737
/// Amount of transfer data completed (bytes)
38+
pub comment: Option<String>,
39+
/// Comment for torrent
3840
pub completed: Option<i64>,
3941
/// Time (Unix Epoch) when the torrent completed
4042
pub completion_on: Option<i64>,
@@ -45,6 +47,8 @@ pub struct Torrent {
4547
pub dl_limit: Option<i64>,
4648
/// Torrent download speed (bytes/s)
4749
pub dlspeed: Option<i64>,
50+
/// Torrent download path
51+
pub download_path: Option<String>,
4852
/// Amount of data downloaded
4953
pub downloaded: Option<i64>,
5054
/// Amount of data downloaded this session
@@ -55,12 +59,22 @@ pub struct Torrent {
5559
pub f_l_piece_prio: Option<bool>,
5660
/// True if force start is enabled for this torrent
5761
pub force_start: Option<bool>,
62+
/// Whether the torrent has metadata
63+
pub has_metadata: Option<bool>,
5864
/// Torrent hash
5965
pub hash: Option<String>,
66+
/// Inactive seeding time limit
67+
pub inactive_seeding_time_limit: Option<i64>,
68+
/// Torrent infohash v1
69+
pub infohash_v1: Option<String>,
70+
/// Torrent infohash v2
71+
pub infohash_v2: Option<String>,
6072
/// Last time (Unix Epoch) when a chunk was downloaded/uploaded
6173
pub last_activity: Option<i64>,
6274
/// Magnet URI corresponding to this torrent
6375
pub magnet_uri: Option<String>,
76+
/// Maximum inactive seeding time
77+
pub max_inactive_seeding_time: Option<i64>,
6478
/// Maximum share ratio until torrent is stopped from seeding/uploading
6579
pub max_ratio: Option<f64>,
6680
/// Maximum seeding time (seconds) until torrent is stopped from seeding
@@ -75,14 +89,22 @@ pub struct Torrent {
7589
pub num_leechs: Option<i64>,
7690
/// Number of seeds connected to
7791
pub num_seeds: Option<i64>,
92+
/// Torrent popularity
93+
pub popularity: Option<f64>,
7894
/// Torrent priority. Returns -1 if queuing is disabled or torrent is in
7995
/// seed mode
8096
pub priority: Option<i64>,
97+
/// Whether this torrent is private
98+
pub private: Option<bool>,
8199
/// Torrent progress (percentage/100)
82100
pub progress: Option<f64>,
83101
/// Torrent share ratio. Max ratio value: 9999.
84102
pub ratio: Option<f64>,
85103
pub ratio_limit: Option<f64>,
104+
/// Torrent reannounce interval
105+
pub reannounce: Option<i64>,
106+
/// Root folder of the torrent
107+
pub root_path: Option<String>,
86108
/// Path where this torrent's data is stored
87109
pub save_path: Option<String>,
88110
/// Torrent elapsed time while complete (seconds)

0 commit comments

Comments
 (0)