mirror of
https://github.com/kristoferssolo/traxor.git
synced 2026-02-04 06:42:04 +00:00
feat: add move
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::Result;
|
||||
use transmission_rpc::types::{Id, Torrent, TorrentAction, TorrentStatus};
|
||||
|
||||
@@ -51,8 +53,17 @@ impl Torrents {
|
||||
.expect("Error stopping all torrents");
|
||||
}
|
||||
|
||||
pub fn move_dir(&mut self) -> Result<()> {
|
||||
todo!()
|
||||
pub async fn move_dir(
|
||||
&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(
|
||||
|
||||
Reference in New Issue
Block a user