mirror of
https://github.com/Readarr/Readarr
synced 2026-01-27 01:42:48 +01:00
parent
2983b60026
commit
a1c2986af8
2 changed files with 8 additions and 4 deletions
|
|
@ -80,7 +80,7 @@ public void should_be_able_to_monitor_all_books()
|
|||
Subject.SetBookMonitoredStatus(_author, new MonitoringOptions { Monitor = MonitorTypes.All });
|
||||
|
||||
Mocker.GetMock<IBookService>()
|
||||
.Verify(v => v.UpdateMany(It.Is<List<Book>>(l => l.All(e => e.Monitored))));
|
||||
.Verify(v => v.UpdateBook(It.Is<Book>(l => l.Monitored)), Times.Exactly(_books.Count));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
@ -101,13 +101,13 @@ public void should_be_able_to_monitor_new_books_only()
|
|||
private void VerifyMonitored(Func<Book, bool> predicate)
|
||||
{
|
||||
Mocker.GetMock<IBookService>()
|
||||
.Verify(v => v.UpdateMany(It.Is<List<Book>>(l => l.Where(predicate).All(e => e.Monitored))));
|
||||
.Verify(v => v.UpdateBook(It.Is<Book>(b => b.Monitored)), Times.AtLeast(_books.Where(predicate).Count()));
|
||||
}
|
||||
|
||||
private void VerifyNotMonitored(Func<Book, bool> predicate)
|
||||
{
|
||||
Mocker.GetMock<IBookService>()
|
||||
.Verify(v => v.UpdateMany(It.Is<List<Book>>(l => l.Where(predicate).All(e => !e.Monitored))));
|
||||
.Verify(v => v.UpdateBook(It.Is<Book>(b => !b.Monitored)), Times.AtLeast(_books.Where(predicate).Count()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,11 @@ public void SetBookMonitoredStatus(Author author, MonitoringOptions monitoringOp
|
|||
}
|
||||
}
|
||||
|
||||
_bookService.UpdateMany(books);
|
||||
// Use individual update to ensure updates are sent to frontend
|
||||
foreach (var book in books)
|
||||
{
|
||||
_bookService.UpdateBook(book);
|
||||
}
|
||||
}
|
||||
|
||||
_authorService.UpdateAuthor(author);
|
||||
|
|
|
|||
Loading…
Reference in a new issue