From 68bfd8bc25d84c632bb18118c7071f6a02a8a681 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 26 Jan 2020 01:13:45 -0500 Subject: [PATCH] Fixed: Edition not Saving to DB due to missing Aggregator --- .../Aggregators/AggregateEdition.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateEdition.cs diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateEdition.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateEdition.cs new file mode 100644 index 000000000..c601a6330 --- /dev/null +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/Aggregation/Aggregators/AggregateEdition.cs @@ -0,0 +1,27 @@ +using NzbDrone.Common.Extensions; +using NzbDrone.Core.Parser.Model; + +namespace NzbDrone.Core.MediaFiles.MovieImport.Aggregation.Aggregators +{ + public class AggregateEdition : IAggregateLocalMovie + { + public LocalMovie Aggregate(LocalMovie localMovie, bool otherFiles) + { + var movieEdition = localMovie.DownloadClientMovieInfo?.Edition; + + if (movieEdition.IsNullOrWhiteSpace()) + { + movieEdition = localMovie.FolderMovieInfo?.Edition; + } + + if (movieEdition.IsNullOrWhiteSpace()) + { + movieEdition = localMovie.FileMovieInfo?.Edition; + } + + localMovie.Edition = movieEdition; + + return localMovie; + } + } +}