From 9cc3ccb41939b1ccb257f48990969b0bb084d2c6 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Wed, 7 Jan 2026 13:15:50 -0700 Subject: [PATCH] feat: Lidarr CLI commands to list quality profiles and metadata profiles --- src/cli/lidarr/list_command_handler.rs | 18 ++++++++++++++++++ src/cli/lidarr/list_command_handler_tests.rs | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/cli/lidarr/list_command_handler.rs b/src/cli/lidarr/list_command_handler.rs index cb0c1a8..9d0b176 100644 --- a/src/cli/lidarr/list_command_handler.rs +++ b/src/cli/lidarr/list_command_handler.rs @@ -20,6 +20,10 @@ mod list_command_handler_tests; pub enum LidarrListCommand { #[command(about = "List all artists in your Lidarr library")] Artists, + #[command(about = "List all Lidarr metadata profiles")] + MetadataProfiles, + #[command(about = "List all Lidarr quality profiles")] + QualityProfiles, #[command(about = "List all Lidarr tags")] Tags, } @@ -58,6 +62,20 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, LidarrListCommand> for LidarrListCommandH .await?; serde_json::to_string_pretty(&resp)? } + LidarrListCommand::MetadataProfiles => { + let resp = self + .network + .handle_network_event(LidarrEvent::GetMetadataProfiles.into()) + .await?; + serde_json::to_string_pretty(&resp)? + } + LidarrListCommand::QualityProfiles => { + let resp = self + .network + .handle_network_event(LidarrEvent::GetQualityProfiles.into()) + .await?; + serde_json::to_string_pretty(&resp)? + } LidarrListCommand::Tags => { let resp = self .network diff --git a/src/cli/lidarr/list_command_handler_tests.rs b/src/cli/lidarr/list_command_handler_tests.rs index 9402480..3933cb6 100644 --- a/src/cli/lidarr/list_command_handler_tests.rs +++ b/src/cli/lidarr/list_command_handler_tests.rs @@ -22,7 +22,9 @@ mod tests { use rstest::rstest; #[rstest] - fn test_list_commands_have_no_arg_requirements(#[values("artists", "tags")] subcommand: &str) { + fn test_list_commands_have_no_arg_requirements( + #[values("artists", "metadata-profiles", "quality-profiles", "tags")] subcommand: &str, + ) { let result = Cli::command().try_get_matches_from(["managarr", "lidarr", "list", subcommand]); assert_ok!(&result); @@ -49,6 +51,8 @@ mod tests { #[rstest] #[case(LidarrListCommand::Artists, LidarrEvent::ListArtists)] + #[case(LidarrListCommand::MetadataProfiles, LidarrEvent::GetMetadataProfiles)] + #[case(LidarrListCommand::QualityProfiles, LidarrEvent::GetQualityProfiles)] #[case(LidarrListCommand::Tags, LidarrEvent::GetTags)] #[tokio::test] async fn test_handle_list_command(