From 35a53c56270aae7dde01b356a07f17b72618aec0 Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 4 Feb 2021 22:22:05 -0500 Subject: [PATCH] New: Store FileId on Import History Events --- src/NzbDrone.Core/History/HistoryService.cs | 3 +-- .../MediaFiles/MovieImport/ImportApprovedMovie.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/History/HistoryService.cs b/src/NzbDrone.Core/History/HistoryService.cs index 055472db1..b2f6e60d3 100644 --- a/src/NzbDrone.Core/History/HistoryService.cs +++ b/src/NzbDrone.Core/History/HistoryService.cs @@ -197,8 +197,7 @@ namespace NzbDrone.Core.History MovieId = movie.Id, }; - //Won't have a value since we publish this event before saving to DB. - //history.Data.Add("FileId", message.ImportedEpisode.Id.ToString()); + history.Data.Add("FileId", message.ImportedMovie.Id.ToString()); history.Data.Add("DroppedPath", message.MovieInfo.Path); history.Data.Add("ImportedPath", Path.Combine(movie.Path, message.ImportedMovie.RelativePath)); history.Data.Add("DownloadClient", message.DownloadClientInfo?.Type); diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs index 1722f9f99..5b4e9845f 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs @@ -128,7 +128,7 @@ namespace NzbDrone.Core.MediaFiles.MovieImport movieFile.RelativePath = localMovie.Movie.Path.GetRelativePath(movieFile.Path); } - _mediaFileService.Add(movieFile); + movieFile = _mediaFileService.Add(movieFile); importResults.Add(new ImportResult(importDecision)); if (newDownload)