Fixed: Include Book for history/since

Fixes #4011
This commit is contained in:
Bogdan
2025-03-27 19:51:00 +02:00
parent d5b0831b0f
commit 6406ed6289

View File

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