feat(cli): Sonarr CLI support for fetching all episodes for a given series

This commit is contained in:
2024-11-15 15:14:34 -07:00
parent 6dffc90e92
commit 1fe95d057b
4 changed files with 68 additions and 9 deletions
+12
View File
@@ -21,6 +21,15 @@ mod list_command_handler_tests;
pub enum SonarrListCommand {
#[command(about = "List all items in the Sonarr blocklist")]
Blocklist,
#[command(about = "List the episodes for the series with the given ID")]
Episodes {
#[arg(
long,
help = "The Sonarr ID of the series whose episodes you wish to fetch",
required = true
)]
series_id: i64,
},
#[command(about = "Fetch Sonarr logs")]
Logs {
#[arg(long, help = "How many log events to fetch", default_value_t = 500)]
@@ -65,6 +74,9 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
SonarrListCommand::Blocklist => {
execute_network_event!(self, SonarrEvent::GetBlocklist);
}
SonarrListCommand::Episodes { series_id } => {
execute_network_event!(self, SonarrEvent::GetEpisodes(Some(series_id)));
}
SonarrListCommand::Logs {
events,
output_in_log_format,