feat(cli): Support for deleting a root folder from Sonarr

This commit is contained in:
2024-11-21 16:46:00 -07:00
parent 1227796e78
commit b24e3bf9db
2 changed files with 71 additions and 0 deletions
+12
View File
@@ -37,6 +37,11 @@ pub enum SonarrDeleteCommand {
#[arg(long, help = "The ID of the indexer to delete", required = true)]
indexer_id: i64,
},
#[command(about = "Delete the root folder with the given ID")]
RootFolder {
#[arg(long, help = "The ID of the root folder to delete", required = true)]
root_folder_id: i64,
},
}
impl From<SonarrDeleteCommand> for Command {
@@ -87,6 +92,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrDeleteCommand> for SonarrDeleteComm
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrDeleteCommand::RootFolder { root_folder_id } => {
let resp = self
.network
.handle_network_event((SonarrEvent::DeleteRootFolder(Some(root_folder_id))).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(resp)