Support torrent activity date

This commit is contained in:
Leopith 2022-09-19 10:51:58 +10:00 committed by Aleksandr
parent 6d12272018
commit 4a8a351e5b
2 changed files with 5 additions and 0 deletions

View File

@ -245,8 +245,10 @@ impl Default for TorrentAddArgs {
}
}
// https://github.com/transmission/transmission/blob/main/docs/rpc-spec.md
#[derive(Clone, Sequence)]
pub enum TorrentGetField {
ActivityDate,
AddedDate,
DoneDate,
DownloadDir,
@ -287,6 +289,7 @@ impl TorrentGetField {
#[must_use]
pub fn to_str(&self) -> String {
match self {
TorrentGetField::ActivityDate => "activityDate",
TorrentGetField::AddedDate => "addedDate",
TorrentGetField::DoneDate => "doneDate",
TorrentGetField::DownloadDir => "downloadDir",

View File

@ -74,6 +74,8 @@ impl RpcResponseArgument for PortTest {}
#[derive(Deserialize, Debug, Clone)]
pub struct Torrent {
#[serde(rename = "activityDate")]
pub activity_date: Option<i64>,
#[serde(rename = "addedDate")]
pub added_date: Option<i64>,
#[serde(rename = "doneDate")]