feat(readarr): fetch the Readarr system status and expose it on the CLI

Add ReadarrEvent::GetStatus, mapped to GET /system/status, and
get_readarr_status in the new readarr_network/system module. It stores
the version and start time on ReadarrData so the system view and the
tick refresh can read them.

Surface it as `managarr readarr get system-status`, matching the
Radarr, Sonarr, and Lidarr spelling of the same call. A `list status`
spelling would have made the same command a different verb on the
fourth servarr, which is a difference the user would have to remember
for no benefit.

Readarr instances answer /system/status with thirty keys; SystemStatus
models the two that are used and serde ignores the rest, as it does for
the other three servarrs.

This is the first ReadarrCommand variant, so ReadarrCliHandler now
reads its app and network fields.
This commit is contained in:
Dark-Alex-17 committed 2026-08-20 15:47:40 -06:00
1 parent cd341c3d71
commit d8f171ec6f
7 files changed
+248 -2

No files matched your search

+19 -2
View File
@@ -2,17 +2,26 @@ use std::sync::Arc;
use anyhow::Result;
use clap::Subcommand;
use get_command_handler::{ReadarrGetCommand, ReadarrGetCommandHandler};
use tokio::sync::Mutex;
use super::{CliCommandHandler, Command};
use crate::{app::App, network::NetworkTrait};
mod get_command_handler;
#[cfg(test)]
#[path = "readarr_command_tests.rs"]
mod readarr_command_tests;
#[derive(Debug, Clone, PartialEq, Eq, Subcommand)]
pub enum ReadarrCommand {}
pub enum ReadarrCommand {
#[command(
subcommand,
about = "Commands to fetch details of the resources in your Readarr instance"
)]
Get(ReadarrGetCommand),
}
impl From<ReadarrCommand> for Command {
fn from(readarr_command: ReadarrCommand) -> Command {
@@ -40,6 +49,14 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, ReadarrCommand> for ReadarrCliHandler<'a,
}
async fn handle(self) -> Result<String> {
match self.command {}
let result = match self.command {
ReadarrCommand::Get(get_command) => {
ReadarrGetCommandHandler::with(self.app, get_command, self.network)
.handle()
.await?
}
};
Ok(result)
}
}