feat(cli): Support for searching for new series to add to Sonarr

This commit is contained in:
2024-11-24 14:58:30 -07:00
parent da3bb795b7
commit 45542cd3a9
3 changed files with 69 additions and 2 deletions
+16
View File
@@ -85,6 +85,15 @@ pub enum SonarrCommand {
)]
history_item_id: i64,
},
#[command(about = "Search for a new series to add to Sonarr")]
SearchNewSeries {
#[arg(
long,
help = "The title of the series you want to search for",
required = true
)]
query: String,
},
#[command(about = "Start the specified Sonarr task")]
StartTask {
#[arg(
@@ -195,6 +204,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
"Sonarr history item marked as 'failed'".to_owned()
}
SonarrCommand::SearchNewSeries { query } => {
let resp = self
.network
.handle_network_event(SonarrEvent::SearchNewSeries(Some(query)).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::StartTask { task_name } => {
let resp = self
.network