feat(cli): Support for triggering an automatic series search in Sonarr

This commit is contained in:
2024-11-22 18:22:33 -07:00
parent a11bce603d
commit 74e9ea17ac
2 changed files with 74 additions and 0 deletions
+16
View File
@@ -99,6 +99,15 @@ pub enum SonarrCommand {
},
#[command(about = "Test all Radarr indexers")]
TestAllIndexers,
#[command(about = "Trigger an automatic search for the series with the specified ID")]
TriggerAutomaticSeriesSearch {
#[arg(
long,
help = "The ID of the series you want to trigger an automatic search for",
required = true
)]
series_id: i64,
},
}
impl From<SonarrCommand> for Command {
@@ -209,6 +218,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::TriggerAutomaticSeriesSearch { series_id } => {
let resp = self
.network
.handle_network_event(SonarrEvent::TriggerAutomaticSeriesSearch(Some(series_id)).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(result)