Fixed: Include Book for history/since

Fixes #4011
pull/4010/head
Bogdan 4 weeks ago
parent d5b0831b0f
commit 6406ed6289

@ -116,6 +116,7 @@ namespace NzbDrone.Core.History
{
var builder = Builder()
.Join<EntityHistory, Author>((h, a) => h.AuthorId == a.Id)
.LeftJoin<EntityHistory, Book>((h, b) => h.BookId == b.Id)
.Where<EntityHistory>(x => x.Date >= date);
if (eventType.HasValue)
@ -123,9 +124,10 @@ namespace NzbDrone.Core.History
builder.Where<EntityHistory>(h => h.EventType == eventType);
}
return _database.QueryJoined<EntityHistory, Author>(builder, (history, author) =>
return _database.QueryJoined<EntityHistory, Author, Book>(builder, (history, author, book) =>
{
history.Author = author;
history.Book = book;
return history;
}).OrderBy(h => h.Date).ToList();
}

Loading…
Cancel
Save