Lidarr support #1

Merged
Dark-Alex-17 merged 61 commits from lidarr into main 2026-01-21 21:30:47 +00:00
2 changed files with 23 additions and 1 deletions
Showing only changes of commit 9cc3ccb419 - Show all commits
+18
View File
@@ -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
+5 -1
View File
@@ -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(