feat(cli): Support for triggering an automatic episode search in Sonarr
This commit is contained in:
@@ -121,6 +121,15 @@ pub enum SonarrCommand {
|
||||
#[arg(long, help = "The season number to search for", required = true)]
|
||||
season_number: i64,
|
||||
},
|
||||
#[command(about = "Trigger an automatic search for the episode with the specified ID")]
|
||||
TriggerAutomaticEpisodeSearch {
|
||||
#[arg(
|
||||
long,
|
||||
help = "The ID of the episode you want to trigger an automatic search for",
|
||||
required = true
|
||||
)]
|
||||
episode_id: i64,
|
||||
},
|
||||
}
|
||||
|
||||
impl From<SonarrCommand> for Command {
|
||||
@@ -250,6 +259,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
SonarrCommand::TriggerAutomaticEpisodeSearch { episode_id } => {
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(SonarrEvent::TriggerAutomaticEpisodeSearch(Some(episode_id)).into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
};
|
||||
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user