feat(cli): Added CLI support for listing Sonarr indexers
This commit is contained in:
@@ -32,6 +32,8 @@ pub enum SonarrListCommand {
|
||||
)]
|
||||
series_id: i64,
|
||||
},
|
||||
#[command(about = "List all Sonarr indexers")]
|
||||
Indexers,
|
||||
#[command(about = "Fetch Sonarr logs")]
|
||||
Logs {
|
||||
#[arg(long, help = "How many log events to fetch", default_value_t = 500)]
|
||||
@@ -84,6 +86,9 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
|
||||
SonarrListCommand::Episodes { series_id } => {
|
||||
execute_network_event!(self, SonarrEvent::GetEpisodes(Some(series_id)));
|
||||
}
|
||||
SonarrListCommand::Indexers => {
|
||||
execute_network_event!(self, SonarrEvent::GetIndexers);
|
||||
}
|
||||
SonarrListCommand::Logs {
|
||||
events,
|
||||
output_in_log_format,
|
||||
|
||||
@@ -24,7 +24,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_list_commands_have_no_arg_requirements(
|
||||
#[values("blocklist", "series", "downloads", "quality-profiles")] subcommand: &str,
|
||||
#[values("blocklist", "series", "downloads", "quality-profiles", "indexers")]
|
||||
subcommand: &str,
|
||||
) {
|
||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", subcommand]);
|
||||
|
||||
@@ -103,6 +104,7 @@ mod tests {
|
||||
#[rstest]
|
||||
#[case(SonarrListCommand::Blocklist, SonarrEvent::GetBlocklist)]
|
||||
#[case(SonarrListCommand::Downloads, SonarrEvent::GetDownloads)]
|
||||
#[case(SonarrListCommand::Indexers, SonarrEvent::GetIndexers)]
|
||||
#[case(SonarrListCommand::QualityProfiles, SonarrEvent::GetQualityProfiles)]
|
||||
#[case(SonarrListCommand::Series, SonarrEvent::ListSeries)]
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user