From b6b7d30fc1ee7b34d337652d02be1abe65811918 Mon Sep 17 00:00:00 2001 From: Jendrik Weise Date: Fri, 6 Sep 2024 15:28:42 +0200 Subject: [PATCH] Fix subtitle aggregation for not populated movie (#10406) --- .../Aggregation/Aggregators/AggregateSubtitleInfo.cs | 2 +- src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateSubtitleInfo.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateSubtitleInfo.cs index 77e090b9f..0e6a80a25 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateSubtitleInfo.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateSubtitleInfo.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.MediaFiles.MovieImport.Aggregation.Aggregators var path = localMovie.Path; var isSubtitleFile = SubtitleFileExtensions.Extensions.Contains(Path.GetExtension(path)); - if (!isSubtitleFile) + if (!isSubtitleFile || localMovie.Movie == null) { return localMovie; } diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs index 0608c6e40..4d14c0620 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs @@ -151,6 +151,8 @@ namespace NzbDrone.Core.MediaFiles.MovieImport movieFile = _mediaFileService.Add(movieFile); importResults.Add(new ImportResult(importDecision)); + localMovie.Movie.MovieFile = movieFile; + if (newDownload) { if (localMovie.ScriptImported)