feat(cli): Support for triggering an automatic season search in Sonarr
This commit is contained in:
@@ -108,6 +108,19 @@ pub enum SonarrCommand {
|
||||
)]
|
||||
series_id: i64,
|
||||
},
|
||||
#[command(
|
||||
about = "Trigger an automatic search for the given season corresponding to the series with the given ID"
|
||||
)]
|
||||
TriggerAutomaticSeasonSearch {
|
||||
#[arg(
|
||||
long,
|
||||
help = "The Sonarr ID of the series whose season you wish to trigger an automatic search for",
|
||||
required = true
|
||||
)]
|
||||
series_id: i64,
|
||||
#[arg(long, help = "The season number to search for", required = true)]
|
||||
season_number: i64,
|
||||
},
|
||||
}
|
||||
|
||||
impl From<SonarrCommand> for Command {
|
||||
@@ -225,6 +238,18 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
SonarrCommand::TriggerAutomaticSeasonSearch {
|
||||
series_id,
|
||||
season_number,
|
||||
} => {
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(
|
||||
SonarrEvent::TriggerAutomaticSeasonSearch(Some((series_id, season_number))).into(),
|
||||
)
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
};
|
||||
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user