diff --git a/src/NzbDrone.Core/History/EntityHistoryRepository.cs b/src/NzbDrone.Core/History/EntityHistoryRepository.cs index 4b66c88b7..5c659724d 100644 --- a/src/NzbDrone.Core/History/EntityHistoryRepository.cs +++ b/src/NzbDrone.Core/History/EntityHistoryRepository.cs @@ -104,6 +104,7 @@ namespace NzbDrone.Core.History var builder = Builder() .Join((h, a) => h.ArtistId == a.Id) .Join((h, a) => h.AlbumId == a.Id) + .LeftJoin((h, t) => h.TrackId == t.Id) .Where(x => x.Date >= date); if (eventType.HasValue) @@ -111,10 +112,11 @@ namespace NzbDrone.Core.History builder.Where(h => h.EventType == eventType); } - return _database.QueryJoined(builder, (history, artist, album) => + return _database.QueryJoined(builder, (history, artist, album, track) => { history.Artist = artist; history.Album = album; + history.Track = track; return history; }).OrderBy(h => h.Date).ToList(); }