fix(readarr): tolerate book payloads that omit the grabbed flag

This commit is contained in:
Dark-Alex-17 committed 2026-09-29 23:25:19 -06:00
1 parent 9128e68d0a
commit 642a5c0a87
2 files changed
+17

No files matched your search

+16
View File
@@ -939,6 +939,22 @@ mod tests {
assert_none!(&book.statistics);
}
#[test]
fn test_book_deserialization_defaults_grabbed_when_absent() {
let book_json = json!({
"id": 1,
"title": "The Name of the Wind",
"authorId": 3,
"foreignBookId": "test-foreign-book-id",
"monitored": true
});
let book: Book = serde_json::from_value(book_json).unwrap();
assert!(!book.grabbed);
assert!(book.monitored);
}
#[test]
fn test_edition_deserialization() {
let edition_json = json!({