add files field for torrent-get

This commit is contained in:
Raphaël BILAND 2021-08-03 11:29:50 +08:00
parent 810ef71537
commit cf1bdb95d2
2 changed files with 11 additions and 0 deletions

View File

@ -208,6 +208,7 @@ pub enum TorrentGetField {
Sizewhendone,
Status,
Trackers,
Files,
Downloaddir,
Uploadedever,
Uploadratio,
@ -248,6 +249,7 @@ impl TorrentGetField {
TorrentGetField::Sizewhendone => "sizeWhenDone",
TorrentGetField::Status => "status",
TorrentGetField::Trackers => "trackers",
TorrentGetField::Files => "files",
TorrentGetField::Downloaddir => "downloadDir",
TorrentGetField::Uploadedever => "uploadedEver",
TorrentGetField::Uploadratio => "uploadRatio",

View File

@ -75,6 +75,7 @@ pub struct Torrent {
pub upload_ratio: Option<f32>,
#[serde(rename = "uploadedEver")]
pub uploaded_ever: Option<i64>,
pub files: Option<Vec<File>>,
}
#[derive(Deserialize, Debug, RustcEncodable)]
@ -89,6 +90,14 @@ pub struct Trackers {
pub announce: String,
}
#[derive(Deserialize, Debug, RustcEncodable, Clone)]
pub struct File {
pub length: i64,
#[serde(rename = "bytesCompleted")]
pub bytes_completed: i64,
pub name: String,
}
#[derive(Deserialize, Debug, RustcEncodable)]
pub struct Nothing {}
impl RpcResponseArgument for Nothing {}