feat(cli): Support for fetching history for a given series ID

This commit is contained in:
2024-11-20 14:58:54 -07:00
parent 86d93377ac
commit df1eea22ab
2 changed files with 69 additions and 0 deletions
+12
View File
@@ -55,6 +55,15 @@ pub enum SonarrListCommand {
QueuedEvents,
#[command(about = "List all series in your Sonarr library")]
Series,
#[command(about = "Fetch all history events for the series with the given ID")]
SeriesHistory {
#[arg(
long,
help = "The Sonarr ID of the series whose history you wish to fetch",
required = true
)]
series_id: i64,
},
}
impl From<SonarrListCommand> for Command {
@@ -127,6 +136,9 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
SonarrListCommand::Series => {
execute_network_event!(self, SonarrEvent::ListSeries);
}
SonarrListCommand::SeriesHistory { series_id } => {
execute_network_event!(self, SonarrEvent::GetSeriesHistory(Some(series_id)));
}
}
Ok(())