feat(readarr): test all indexers and expose the command on the CLI
Results come back keyed only by indexer id, so each one is joined against the cached indexer list to recover a display name, and its validation failures are flattened into a single line for the results table. The endpoint reports failures with a non-2xx status, so the request ignores the status code and parses the body either way. When the request itself fails the results table is replaced with an empty one rather than being left showing the previous run.
This commit is contained in:
7 files changed
+245
-6
No files matched your search
@@ -110,6 +110,8 @@ pub enum ReadarrCommand {
|
||||
)]
|
||||
task_name: ReadarrTaskName,
|
||||
},
|
||||
#[command(about = "Test all Readarr indexers")]
|
||||
TestAllIndexers,
|
||||
#[command(
|
||||
about = "Test the indexer with the given ID. Note that a successful test returns an empty JSON body; i.e. '{}'"
|
||||
)]
|
||||
@@ -247,6 +249,14 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, ReadarrCommand> for ReadarrCliHandler<'a,
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
ReadarrCommand::TestAllIndexers => {
|
||||
println!("Testing all Readarr indexers. This may take a minute...");
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(ReadarrEvent::TestAllIndexers.into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
ReadarrCommand::TestIndexer { indexer_id } => {
|
||||
let resp = self
|
||||
.network
|
||||
|
||||
Reference in new issue
Block a user