mirror of
https://github.com/kristoferssolo/transmission-rpc.git
synced 2025-10-21 20:10:37 +00:00
deserialize by chrono::serde
This commit is contained in:
parent
07e1080e91
commit
a79f6b0e73
@ -22,6 +22,7 @@ reqwest = { version = "0.11.22", features = [
|
|||||||
serde = { version = "1.0.190", features = ["derive"] }
|
serde = { version = "1.0.190", features = ["derive"] }
|
||||||
serde_repr = "0.1.17"
|
serde_repr = "0.1.17"
|
||||||
enum-iterator = "1.4.1"
|
enum-iterator = "1.4.1"
|
||||||
|
chrono = {version = "0.4.31", features = ["serde"] }
|
||||||
|
|
||||||
log = "0.4.20"
|
log = "0.4.20"
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
use chrono::serde::ts_seconds::deserialize as from_ts;
|
||||||
|
use chrono::{DateTime, Utc};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde_repr::*;
|
use serde_repr::*;
|
||||||
|
|
||||||
@ -204,18 +206,24 @@ pub struct TrackerStat {
|
|||||||
pub is_backup: bool,
|
pub is_backup: bool,
|
||||||
pub last_announce_peer_count: i64,
|
pub last_announce_peer_count: i64,
|
||||||
pub last_announce_result: String,
|
pub last_announce_result: String,
|
||||||
pub last_announce_start_time: i64,
|
#[serde(deserialize_with = "from_ts")]
|
||||||
|
pub last_announce_start_time: DateTime<Utc>,
|
||||||
pub last_announce_succeeded: bool,
|
pub last_announce_succeeded: bool,
|
||||||
pub last_announce_time: i64,
|
#[serde(deserialize_with = "from_ts")]
|
||||||
|
pub last_announce_time: DateTime<Utc>,
|
||||||
pub last_announce_timed_out: bool,
|
pub last_announce_timed_out: bool,
|
||||||
pub last_scrape_result: String,
|
pub last_scrape_result: String,
|
||||||
pub last_scrape_start_time: i64,
|
#[serde(deserialize_with = "from_ts")]
|
||||||
|
pub last_scrape_start_time: DateTime<Utc>,
|
||||||
pub last_scrape_succeeded: bool,
|
pub last_scrape_succeeded: bool,
|
||||||
pub last_scrape_time: i64,
|
#[serde(deserialize_with = "from_ts")]
|
||||||
|
pub last_scrape_time: DateTime<Utc>,
|
||||||
pub last_scrape_timed_out: bool,
|
pub last_scrape_timed_out: bool,
|
||||||
pub leecher_count: i64,
|
pub leecher_count: i64,
|
||||||
pub next_announce_time: i64,
|
#[serde(deserialize_with = "from_ts")]
|
||||||
pub next_scrape_time: i64,
|
pub next_announce_time: DateTime<Utc>,
|
||||||
|
#[serde(deserialize_with = "from_ts")]
|
||||||
|
pub next_scrape_time: DateTime<Utc>,
|
||||||
pub scrape_state: TrackerState,
|
pub scrape_state: TrackerState,
|
||||||
pub scrape: String,
|
pub scrape: String,
|
||||||
pub seeder_count: i64,
|
pub seeder_count: i64,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user