From bae555f63e8875f8f5533ea5e94393188a998dcc Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 13 Apr 2023 21:55:01 -0500 Subject: [PATCH] Fixed: Custom Format calculation error on Blocklist by Movie Fixes #8136 --- src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs b/src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs index 5dfc96c6e..443c85992 100644 --- a/src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs +++ b/src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using NzbDrone.Core.Datastore; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Movies; @@ -32,7 +33,14 @@ namespace NzbDrone.Core.Blocklisting public List BlocklistedByMovie(int movieId) { - return Query(x => x.MovieId == movieId); + var builder = Builder().Join((h, a) => h.MovieId == a.Id) + .Where(h => h.MovieId == movieId); + + return _database.QueryJoined(builder, (blocklist, movie) => + { + blocklist.Movie = movie; + return blocklist; + }).OrderByDescending(h => h.Date).ToList(); } public void DeleteForMovies(List movieIds)