diff --git a/src/cli/sonarr/list_command_handler.rs b/src/cli/sonarr/list_command_handler.rs index 697292b..92ec8c9 100644 --- a/src/cli/sonarr/list_command_handler.rs +++ b/src/cli/sonarr/list_command_handler.rs @@ -62,6 +62,8 @@ pub enum SonarrListCommand { #[command(about = "List all queued events")] QueuedEvents, #[command(about = "List all series in your Sonarr library")] + #[command(about = "List all root folders in Sonarr")] + RootFolders, Series, #[command(about = "Fetch all history events for the series with the given ID")] SeriesHistory { @@ -174,6 +176,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH .await?; serde_json::to_string_pretty(&resp)? } + SonarrListCommand::RootFolders => { + let resp = self + .network + .handle_network_event((SonarrEvent::GetRootFolders).into()) + .await?; + serde_json::to_string_pretty(&resp)? + } SonarrListCommand::Series => { let resp = self .network diff --git a/src/cli/sonarr/list_command_handler_tests.rs b/src/cli/sonarr/list_command_handler_tests.rs index e0d2e8a..b8ed298 100644 --- a/src/cli/sonarr/list_command_handler_tests.rs +++ b/src/cli/sonarr/list_command_handler_tests.rs @@ -30,7 +30,8 @@ mod tests { "downloads", "quality-profiles", "indexers", - "queued-events" + "queued-events", + "root-folders" )] subcommand: &str, ) { @@ -199,6 +200,7 @@ mod tests { #[case(SonarrListCommand::Indexers, SonarrEvent::GetIndexers)] #[case(SonarrListCommand::QualityProfiles, SonarrEvent::GetQualityProfiles)] #[case(SonarrListCommand::QueuedEvents, SonarrEvent::GetQueuedEvents)] + #[case(SonarrListCommand::RootFolders, SonarrEvent::GetRootFolders)] #[case(SonarrListCommand::Series, SonarrEvent::ListSeries)] #[tokio::test] async fn test_handle_list_command(