feat(cli): Support for deleting an episode file from disk

This commit is contained in:
2024-11-25 14:46:33 -07:00
parent 4f86cce497
commit 1dd4cd74c3
2 changed files with 45 additions and 0 deletions
+12
View File
@@ -33,6 +33,11 @@ pub enum SonarrDeleteCommand {
#[arg(long, help = "The ID of the download to delete", required = true)]
download_id: i64,
},
#[command(about = "Delete the specified episode file from disk")]
EpisodeFile {
#[arg(long, help = "The ID of the episode file to delete", required = true)]
episode_file_id: i64,
},
#[command(about = "Delete the indexer with the given ID")]
Indexer {
#[arg(long, help = "The ID of the indexer to delete", required = true)]
@@ -100,6 +105,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrDeleteCommand> for SonarrDeleteComm
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrDeleteCommand::EpisodeFile { episode_file_id } => {
let resp = self
.network
.handle_network_event(SonarrEvent::DeleteEpisodeFile(Some(episode_file_id)).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrDeleteCommand::Indexer { indexer_id } => {
let resp = self
.network