From ff38afd198e4078dd1c29fa777403c9c2e52a6d6 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 18 Oct 2024 07:19:09 +0300 Subject: [PATCH] Fixed: Add only movies with release dates from monitored collections --- src/NzbDrone.Core/Movies/RefreshCollectionService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Movies/RefreshCollectionService.cs b/src/NzbDrone.Core/Movies/RefreshCollectionService.cs index 4608225a4..1f983b5c4 100644 --- a/src/NzbDrone.Core/Movies/RefreshCollectionService.cs +++ b/src/NzbDrone.Core/Movies/RefreshCollectionService.cs @@ -125,10 +125,14 @@ private void SyncCollectionMovies(MovieCollection collection) { if (collection.Monitored) { + var collectionMovies = _movieMetadataService + .GetMoviesByCollectionTmdbId(collection.TmdbId) + .Where(m => m.Status is MovieStatusType.InCinemas or MovieStatusType.Released) + .ToList(); + var existingMovies = _movieService.AllMovieTmdbIds(); - var collectionMovies = _movieMetadataService.GetMoviesByCollectionTmdbId(collection.TmdbId); var excludedMovies = _importListExclusionService.All().Select(e => e.TmdbId); - var moviesToAdd = collectionMovies.Where(m => !existingMovies.Contains(m.TmdbId)).Where(m => !excludedMovies.Contains(m.TmdbId)); + var moviesToAdd = collectionMovies.Where(m => !existingMovies.Contains(m.TmdbId)).Where(m => !excludedMovies.Contains(m.TmdbId)).ToList(); if (moviesToAdd.Any()) {