This commit is contained in:
red 2020-04-22 09:52:56 +02:00
parent f2420e876a
commit e88de4bd72
2 changed files with 4 additions and 4 deletions

View File

@ -2,9 +2,9 @@ Library to communicate with transmission rpc
spec: https://github.com/transmission/transmission/blob/master/extras/rpc-spec.txt spec: https://github.com/transmission/transmission/blob/master/extras/rpc-spec.txt
Supported Methods: #### Supported Methods
Torrent Actions: ##### Torrent Actions
- [X] torrent-start - [X] torrent-start
- [X] torrent-stop - [X] torrent-stop
@ -12,7 +12,7 @@ Torrent Actions:
- [X] torrent-verify - [X] torrent-verify
- [X] torrent-reannounce - [X] torrent-reannounce
Torrent modificators: ##### Torrent Mutators
- [ ] torrent-set - [ ] torrent-set
- [X] torrent-get - [X] torrent-get

View File

@ -120,7 +120,7 @@ mod tests {
let url= env::var("TURL")?; let url= env::var("TURL")?;
let basic_auth = BasicAuth{user: env::var("TUSER")?, password: env::var("TPWD")?}; let basic_auth = BasicAuth{user: env::var("TUSER")?, password: env::var("TPWD")?};
let client = TransClient::with_auth(&url, basic_auth); let client = TransClient::with_auth(&url, basic_auth);
let res: RpcResponse<Torrents<Torrent>> = client.torrent_get(vec![TorrentGetField::ID, TorrentGetField::NAME]).await?; let res: RpcResponse<Torrents<Torrent>> = client.torrent_get(vec![TorrentGetField::Id, TorrentGetField::Name]).await?;
let names: Vec<&String> = res.arguments.torrents.iter().map(|it| it.name.as_ref().unwrap()).collect(); let names: Vec<&String> = res.arguments.torrents.iter().map(|it| it.name.as_ref().unwrap()).collect();
println!("{:#?}", names); println!("{:#?}", names);
Ok(()) Ok(())