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:
7 files changed
+232
No files matched your search
@@ -17,6 +17,8 @@ mod list_command_handler_tests;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Subcommand)]
|
||||
pub enum ReadarrListCommand {
|
||||
#[command(about = "List all authors in your Readarr library")]
|
||||
Authors,
|
||||
#[command(about = "List disk space details for all provisioned root folders in Readarr")]
|
||||
DiskSpace,
|
||||
#[command(about = "Fetch Readarr logs")]
|
||||
@@ -72,6 +74,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, ReadarrListCommand> for ReadarrListComman
|
||||
|
||||
async fn handle(self) -> Result<String> {
|
||||
let result = match self.command {
|
||||
ReadarrListCommand::Authors => {
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(ReadarrEvent::ListAuthors.into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
ReadarrListCommand::DiskSpace => {
|
||||
let resp = self
|
||||
.network
|
||||
|
||||
Reference in new issue
Block a user