mirror of
https://github.com/kristoferssolo/traxor.git
synced 2025-10-21 20:10:35 +00:00
feat: add move
This commit is contained in:
parent
e0e95b07b1
commit
c97a416d68
@ -1,3 +1,5 @@
|
|||||||
|
use std::path::Path;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use transmission_rpc::types::{Id, Torrent, TorrentAction, TorrentStatus};
|
use transmission_rpc::types::{Id, Torrent, TorrentAction, TorrentStatus};
|
||||||
|
|
||||||
@ -51,8 +53,17 @@ impl Torrents {
|
|||||||
.expect("Error stopping all torrents");
|
.expect("Error stopping all torrents");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn move_dir(&mut self) -> Result<()> {
|
pub async fn move_dir(
|
||||||
todo!()
|
&mut self,
|
||||||
|
torrent: &Torrent,
|
||||||
|
location: &Path,
|
||||||
|
move_from: Option<bool>,
|
||||||
|
) -> transmission_rpc::types::Result<()> {
|
||||||
|
let id = torrent.id().expect("ID not found");
|
||||||
|
self.client
|
||||||
|
.torrent_set_location(vec![id], location.to_string_lossy().into(), move_from)
|
||||||
|
.await?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn delete(
|
pub async fn delete(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user