diff --git a/src/cli/radarr/list_command_handler.rs b/src/cli/radarr/list_command_handler.rs index 7d0962e..b769033 100644 --- a/src/cli/radarr/list_command_handler.rs +++ b/src/cli/radarr/list_command_handler.rs @@ -57,7 +57,7 @@ pub enum RadarrListCommand { RootFolders, #[command(about = "List all Radarr tags")] Tags, - #[command(about = "List tasks")] + #[command(about = "List all Radarr tasks")] Tasks, #[command(about = "List all Radarr updates")] Updates, diff --git a/src/cli/sonarr/list_command_handler.rs b/src/cli/sonarr/list_command_handler.rs index ff35417..ba85fae 100644 --- a/src/cli/sonarr/list_command_handler.rs +++ b/src/cli/sonarr/list_command_handler.rs @@ -78,6 +78,8 @@ pub enum SonarrListCommand { }, #[command(about = "List all Sonarr tags")] Tags, + #[command(about = "List all Sonarr tasks")] + Tasks, } impl From for Command { @@ -215,6 +217,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH .await?; serde_json::to_string_pretty(&resp)? } + SonarrListCommand::Tasks => { + let resp = self + .network + .handle_network_event(SonarrEvent::GetTasks.into()) + .await?; + serde_json::to_string_pretty(&resp)? + } }; Ok(result) diff --git a/src/cli/sonarr/list_command_handler_tests.rs b/src/cli/sonarr/list_command_handler_tests.rs index 9d4bab5..21ac81d 100644 --- a/src/cli/sonarr/list_command_handler_tests.rs +++ b/src/cli/sonarr/list_command_handler_tests.rs @@ -33,7 +33,8 @@ mod tests { "indexers", "queued-events", "root-folders", - "tags" + "tags", + "tasks" )] subcommand: &str, ) { @@ -206,6 +207,7 @@ mod tests { #[case(SonarrListCommand::RootFolders, SonarrEvent::GetRootFolders)] #[case(SonarrListCommand::Series, SonarrEvent::ListSeries)] #[case(SonarrListCommand::Tags, SonarrEvent::GetTags)] + #[case(SonarrListCommand::Tasks, SonarrEvent::GetTasks)] #[tokio::test] async fn test_handle_list_command( #[case] list_command: SonarrListCommand,