mirror of
https://github.com/kristoferssolo/transmission-rpc.git
synced 2025-12-30 13:21:49 +00:00
add trackerStats and trackerList to torrent-get params
This commit is contained in:
parent
04bbbd6f66
commit
07e1080e91
@ -1,5 +1,5 @@
|
|||||||
use enum_iterator::{all, Sequence};
|
use enum_iterator::{all, Sequence};
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||||
|
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Debug)]
|
||||||
@ -414,7 +414,7 @@ pub struct TorrentRenamePathArgs {
|
|||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug, Clone)]
|
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum Id {
|
pub enum Id {
|
||||||
Id(i64),
|
Id(i64),
|
||||||
@ -511,6 +511,8 @@ pub enum TorrentGetField {
|
|||||||
TorrentFile,
|
TorrentFile,
|
||||||
TotalSize,
|
TotalSize,
|
||||||
Trackers,
|
Trackers,
|
||||||
|
TrackerList,
|
||||||
|
TrackerStats,
|
||||||
UploadRatio,
|
UploadRatio,
|
||||||
UploadedEver,
|
UploadedEver,
|
||||||
Wanted,
|
Wanted,
|
||||||
@ -559,6 +561,8 @@ impl TorrentGetField {
|
|||||||
TorrentGetField::TorrentFile => "torrentFile",
|
TorrentGetField::TorrentFile => "torrentFile",
|
||||||
TorrentGetField::TotalSize => "totalSize",
|
TorrentGetField::TotalSize => "totalSize",
|
||||||
TorrentGetField::Trackers => "trackers",
|
TorrentGetField::Trackers => "trackers",
|
||||||
|
TorrentGetField::TrackerList => "trackerList",
|
||||||
|
TorrentGetField::TrackerStats => "trackerStats",
|
||||||
TorrentGetField::UploadRatio => "uploadRatio",
|
TorrentGetField::UploadRatio => "uploadRatio",
|
||||||
TorrentGetField::UploadedEver => "uploadedEver",
|
TorrentGetField::UploadedEver => "uploadedEver",
|
||||||
TorrentGetField::Wanted => "wanted",
|
TorrentGetField::Wanted => "wanted",
|
||||||
|
|||||||
@ -130,6 +130,8 @@ pub struct Torrent {
|
|||||||
pub torrent_file: Option<String>,
|
pub torrent_file: Option<String>,
|
||||||
pub total_size: Option<i64>,
|
pub total_size: Option<i64>,
|
||||||
pub trackers: Option<Vec<Trackers>>,
|
pub trackers: Option<Vec<Trackers>>,
|
||||||
|
pub tracker_list: Option<String>,
|
||||||
|
pub tracker_stats: Option<Vec<TrackerStat>>,
|
||||||
pub upload_ratio: Option<f32>,
|
pub upload_ratio: Option<f32>,
|
||||||
pub uploaded_ever: Option<i64>,
|
pub uploaded_ever: Option<i64>,
|
||||||
pub files: Option<Vec<File>>,
|
pub files: Option<Vec<File>>,
|
||||||
@ -189,6 +191,47 @@ pub struct FileStat {
|
|||||||
pub priority: Priority,
|
pub priority: Priority,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct TrackerStat {
|
||||||
|
pub announce_state: TrackerState,
|
||||||
|
pub announce: String,
|
||||||
|
pub download_count: i64,
|
||||||
|
pub has_announced: bool,
|
||||||
|
pub has_scraped: bool,
|
||||||
|
pub host: String,
|
||||||
|
pub id: Id,
|
||||||
|
pub is_backup: bool,
|
||||||
|
pub last_announce_peer_count: i64,
|
||||||
|
pub last_announce_result: String,
|
||||||
|
pub last_announce_start_time: i64,
|
||||||
|
pub last_announce_succeeded: bool,
|
||||||
|
pub last_announce_time: i64,
|
||||||
|
pub last_announce_timed_out: bool,
|
||||||
|
pub last_scrape_result: String,
|
||||||
|
pub last_scrape_start_time: i64,
|
||||||
|
pub last_scrape_succeeded: bool,
|
||||||
|
pub last_scrape_time: i64,
|
||||||
|
pub last_scrape_timed_out: bool,
|
||||||
|
pub leecher_count: i64,
|
||||||
|
pub next_announce_time: i64,
|
||||||
|
pub next_scrape_time: i64,
|
||||||
|
pub scrape_state: TrackerState,
|
||||||
|
pub scrape: String,
|
||||||
|
pub seeder_count: i64,
|
||||||
|
pub sitename: String,
|
||||||
|
pub tier: usize,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize_repr, Debug, Clone)]
|
||||||
|
#[repr(i8)]
|
||||||
|
pub enum TrackerState {
|
||||||
|
Inactive = 0,
|
||||||
|
Waiting = 1,
|
||||||
|
Queued = 2,
|
||||||
|
Active = 3,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct Nothing {}
|
pub struct Nothing {}
|
||||||
impl RpcResponseArgument for Nothing {}
|
impl RpcResponseArgument for Nothing {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user