feat(readarr): fetch Readarr authors and expose them on the CLI

Add ReadarrEvent::ListAuthors, mapping to GET /author, and wire it up as
`managarr readarr list authors`.

This is the first Readarr event that touches the library rather than
configuration, so it creates the library/authors module tree mirroring
Lidarr's library/artists layout.

list_authors mirrors Lidarr's list_artists, including the sort-prompt
route guard: a response landing while the user has the sort prompt open
must not clobber their in-progress sort selection. Both directions of
that guard are covered by tests.
This commit is contained in:
Dark-Alex-17 committed 2026-08-26 11:41:42 -06:00
1 parent e1be1df68a
commit 84eba9beac
7 files changed
+232

No files matched your search

+4
View File
@@ -7,6 +7,7 @@ use crate::models::readarr_models::{AddReadarrRootFolderBody, ReadarrSerdeable,
use crate::models::servarr_models::{MetadataProfile, QualityProfile, Tag};
use crate::network::{Network, RequestMethod};
mod library;
mod root_folders;
mod system;
@@ -33,12 +34,14 @@ pub enum ReadarrEvent {
GetTasks,
GetUpdates,
HealthCheck,
ListAuthors,
StartTask(ReadarrTaskName),
}
impl NetworkResource for ReadarrEvent {
fn resource(&self) -> &'static str {
match &self {
ReadarrEvent::ListAuthors => "/author",
ReadarrEvent::GetQueuedEvents | ReadarrEvent::StartTask(_) => "/command",
ReadarrEvent::GetHostConfig | ReadarrEvent::GetSecurityConfig => "/config/host",
ReadarrEvent::GetDiskSpace => "/diskspace",
@@ -122,6 +125,7 @@ impl Network<'_, '_> {
.get_readarr_healthcheck()
.await
.map(ReadarrSerdeable::from),
ReadarrEvent::ListAuthors => self.list_authors().await.map(ReadarrSerdeable::from),
ReadarrEvent::StartTask(task_name) => self
.start_readarr_task(task_name)
.await