feat(readarr): test an indexer and expose the command on the CLI

Fetch the indexer's full details, then post them back verbatim to the
test endpoint. The payload round-trips through serde_json::Value so the
fields Indexer does not model, such as infoLink and the per-field label
and type metadata, survive the round trip intact.

A successful test returns an empty JSON object and clears
indexer_test_errors; a failure returns an array whose first entry
carries the error message. The test endpoint reports failures with a
non-2xx status, so the request ignores the status code and parses the
body either way.
This commit is contained in:
Dark-Alex-17 committed 2026-09-02 13:39:29 -06:00
1 parent aea7fd2607
commit f4fd8516a6
6 files changed
+267

No files matched your search

+14
View File
@@ -110,6 +110,13 @@ pub enum ReadarrCommand {
)]
task_name: ReadarrTaskName,
},
#[command(
about = "Test the indexer with the given ID. Note that a successful test returns an empty JSON body; i.e. '{}'"
)]
TestIndexer {
#[arg(long, help = "The ID of the indexer to test", required = true)]
indexer_id: i64,
},
#[command(
about = "Toggle monitoring for the specified author corresponding to the given author ID"
)]
@@ -240,6 +247,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, ReadarrCommand> for ReadarrCliHandler<'a,
.await?;
serde_json::to_string_pretty(&resp)?
}
ReadarrCommand::TestIndexer { indexer_id } => {
let resp = self
.network
.handle_network_event(ReadarrEvent::TestIndexer(indexer_id).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
ReadarrCommand::ToggleAuthorMonitoring { author_id } => {
let resp = self
.network