mirror of
https://github.com/kristoferssolo/traxor.git
synced 2025-10-21 20:10:35 +00:00
feat: add rename
This commit is contained in:
parent
c97a416d68
commit
0171e8e135
@ -78,8 +78,17 @@ impl Torrents {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn rename(&mut self) -> Result<()> {
|
||||
todo!()
|
||||
pub async fn rename(
|
||||
&mut self,
|
||||
torrent: &Torrent,
|
||||
name: &Path,
|
||||
) -> transmission_rpc::types::Result<()> {
|
||||
let id = torrent.id().expect("ID not found");
|
||||
let old_name = torrent.name.clone().unwrap();
|
||||
self.client
|
||||
.torrent_rename_path(vec![id], old_name, name.to_string_lossy().into())
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn action_all(&mut self, action: TorrentAction) -> transmission_rpc::types::Result<()> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user