feat(readarr): trigger an automatic book search and expose the command on the CLI

This commit is contained in:
Dark-Alex-17 committed 2026-08-27 15:52:44 -06:00
1 parent b48ce5db2e
commit f2787560d6
6 files changed
+159 -1

No files matched your search

@@ -27,6 +27,15 @@ pub enum ReadarrTriggerAutomaticSearchCommand {
)]
author_id: i64,
},
#[command(about = "Trigger an automatic search for the book with the specified ID")]
Book {
#[arg(
long,
help = "The ID of the book you want to trigger an automatic search for",
required = true
)]
book_id: i64,
},
}
impl From<ReadarrTriggerAutomaticSearchCommand> for Command {
@@ -65,6 +74,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, ReadarrTriggerAutomaticSearchCommand>
.await?;
serde_json::to_string_pretty(&resp)?
}
ReadarrTriggerAutomaticSearchCommand::Book { book_id } => {
let resp = self
.network
.handle_network_event(ReadarrEvent::TriggerAutomaticBookSearch(book_id).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(result)