Fixed: UI updates when new author book monitor state set

Fixes #1298
This commit is contained in:
ta264
2021-11-14 21:28:58 +00:00
parent 2983b60026
commit a1c2986af8
2 changed files with 8 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ namespace NzbDrone.Core.Test.MusicTests.BookMonitoredServiceTests
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 @@ namespace NzbDrone.Core.Test.MusicTests.BookMonitoredServiceTests
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()));
}
}
}

View File

@@ -86,7 +86,11 @@ namespace NzbDrone.Core.Books
}
}
_bookService.UpdateMany(books);
// Use individual update to ensure updates are sent to frontend
foreach (var book in books)
{
_bookService.UpdateBook(book);
}
}
_authorService.UpdateAuthor(author);