feat(readarr): toggle book monitoring and expose the command on the CLI
The PUT body round-trips through serde_json::Value rather than the typed Book, so the fields Readarr returns but Book does not declare survive the toggle instead of being silently dropped. BOOK_JSON now carries a few of those undeclared fields so a regression to a typed round-trip fails the tests rather than passing unnoticed.
This commit is contained in:
7 files changed
+222
-3
No files matched your search
@@ -55,6 +55,7 @@ pub enum ReadarrEvent {
|
||||
SearchNewAuthor(String),
|
||||
StartTask(ReadarrTaskName),
|
||||
ToggleAuthorMonitoring(i64),
|
||||
ToggleBookMonitoring(i64),
|
||||
TriggerAutomaticAuthorSearch(i64),
|
||||
TriggerAutomaticBookSearch(i64),
|
||||
UpdateAllAuthors,
|
||||
@@ -71,7 +72,9 @@ impl NetworkResource for ReadarrEvent {
|
||||
| ReadarrEvent::ListAuthors
|
||||
| ReadarrEvent::ToggleAuthorMonitoring(_) => "/author",
|
||||
ReadarrEvent::SearchNewAuthor(_) => "/author/lookup",
|
||||
ReadarrEvent::GetBookDetails(_) | ReadarrEvent::GetBooks(_) => "/book",
|
||||
ReadarrEvent::GetBookDetails(_)
|
||||
| ReadarrEvent::GetBooks(_)
|
||||
| ReadarrEvent::ToggleBookMonitoring(_) => "/book",
|
||||
ReadarrEvent::GetBookFiles(_) => "/bookfile",
|
||||
ReadarrEvent::GetQueuedEvents
|
||||
| ReadarrEvent::StartTask(_)
|
||||
@@ -211,6 +214,10 @@ impl Network<'_, '_> {
|
||||
.toggle_author_monitoring(author_id)
|
||||
.await
|
||||
.map(ReadarrSerdeable::from),
|
||||
ReadarrEvent::ToggleBookMonitoring(book_id) => self
|
||||
.toggle_book_monitoring(book_id)
|
||||
.await
|
||||
.map(ReadarrSerdeable::from),
|
||||
ReadarrEvent::TriggerAutomaticAuthorSearch(author_id) => self
|
||||
.trigger_automatic_author_search(author_id)
|
||||
.await
|
||||
|
||||
Reference in new issue
Block a user