Fixed: Store Custom Format score during import

Closes #5291
This commit is contained in:
Mark McDowall 2022-12-11 17:09:11 -08:00 committed by Mark McDowall
parent 4ed4ca4804
commit 899d6ddbab
4 changed files with 9 additions and 0 deletions

View File

@ -220,6 +220,7 @@ namespace NzbDrone.Core.History
history.Data.Add("DownloadClient", message.DownloadClientInfo?.Type);
history.Data.Add("DownloadClientName", message.DownloadClientInfo?.Name);
history.Data.Add("ReleaseGroup", message.EpisodeInfo.ReleaseGroup);
history.Data.Add("CustomFormatScore", message.EpisodeInfo.CustomFormatScore.ToString());
_historyRepository.Insert(history);
}

View File

@ -140,6 +140,9 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
}
else
{
localEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(localEpisode);
localEpisode.CustomFormatScore = localEpisode.Series.QualityProfile?.Value.CalculateCustomFormatScore(localEpisode.CustomFormats) ?? 0;
decision = GetDecision(localEpisode, downloadClientItem);
}
}

View File

@ -487,6 +487,8 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
// Augment episode file so imported files have all additional information an automatic import would
localEpisode = _aggregationService.Augment(localEpisode, trackedDownload?.DownloadItem);
localEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(localEpisode);
localEpisode.CustomFormatScore = localEpisode.Series.QualityProfile?.Value.CalculateCustomFormatScore(localEpisode.CustomFormats) ?? 0;
// Apply the user-chosen values.
localEpisode.Series = series;

View File

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles.MediaInfo;
using NzbDrone.Core.Qualities;
@ -31,6 +32,8 @@ namespace NzbDrone.Core.Parser.Model
public string ReleaseGroup { get; set; }
public string SceneName { get; set; }
public bool OtherVideoFiles { get; set; }
public List<CustomFormat> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public int SeasonNumber
{