Fixed: Recalculate Custom Format Score in Manual Import

This commit is contained in:
Bogdan 2023-07-25 22:25:04 +03:00 committed by Mark McDowall
parent 3937545e15
commit cda9cf726a
5 changed files with 12 additions and 2 deletions

View File

@ -431,7 +431,10 @@ function InteractiveImportRow(props: InteractiveImportRowProps) {
<TableRowCell>
{customFormats?.length ? (
<Popover
anchor={formatCustomFormatScore(customFormatScore)}
anchor={formatCustomFormatScore(
customFormatScore,
customFormats.length
)}
title={translate('CustomFormats')}
body={
<div className={styles.customFormatTooltip}>

View File

@ -23,6 +23,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
public string ReleaseGroup { get; set; }
public string DownloadId { get; set; }
public List<CustomFormat> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public IEnumerable<Rejection> Rejections { get; set; }
public ManualImportItem()

View File

@ -393,6 +393,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
item.Series = decision.LocalEpisode.Series;
item.CustomFormats = _formatCalculator.ParseCustomFormat(decision.LocalEpisode);
item.CustomFormatScore = item.Series.QualityProfile?.Value.CalculateCustomFormatScore(item.CustomFormats) ?? 0;
}
if (decision.LocalEpisode.Episodes.Any() && decision.LocalEpisode.Episodes.Select(c => c.SeasonNumber).Distinct().Count() == 1)

View File

@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles.EpisodeImport.Manual;
using NzbDrone.Core.Qualities;
using Sonarr.Api.V3.CustomFormats;
using Sonarr.Api.V3.Episodes;
using Sonarr.Http;
@ -43,6 +44,8 @@ namespace Sonarr.Api.V3.ManualImport
item.SeasonNumber = processedItem.SeasonNumber;
item.Episodes = processedItem.Episodes.ToResource();
item.Rejections = processedItem.Rejections;
item.CustomFormats = processedItem.CustomFormats.ToResource(false);
item.CustomFormatScore = processedItem.CustomFormatScore;
// Only set the language/quality if they're unknown and languages were returned.
// Languages won't be returned when reprocessing if the season/episode isn't filled in yet and we don't want to return no languages to the client.

View File

@ -2,6 +2,7 @@ using System.Collections.Generic;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Qualities;
using Sonarr.Api.V3.CustomFormats;
using Sonarr.Api.V3.Episodes;
using Sonarr.Http.REST;
@ -18,7 +19,8 @@ namespace Sonarr.Api.V3.ManualImport
public List<Language> Languages { get; set; }
public string ReleaseGroup { get; set; }
public string DownloadId { get; set; }
public List<CustomFormatResource> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public IEnumerable<Rejection> Rejections { get; set; }
}
}