feat(cli): Support for testing all Sonarr indexers at once

This commit is contained in:
2024-11-22 17:38:11 -07:00
parent 6896fcc134
commit 8807adea83
3 changed files with 37 additions and 2 deletions
+10
View File
@@ -97,6 +97,8 @@ pub enum SonarrCommand {
#[arg(long, help = "The ID of the indexer to test", required = true)]
indexer_id: i64,
},
#[command(about = "Test all Radarr indexers")]
TestAllIndexers,
}
impl From<SonarrCommand> for Command {
@@ -199,6 +201,14 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::TestAllIndexers => {
println!("Testing all Sonarr indexers. This may take a minute...");
let resp = self
.network
.handle_network_event(SonarrEvent::TestAllIndexers.into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(result)