mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-03-17 21:17:50 +02:00
Fixed: Recalculate Custom Format Score in Manual Import
This commit is contained in:
parent
3937545e15
commit
cda9cf726a
@ -431,7 +431,10 @@ function InteractiveImportRow(props: InteractiveImportRowProps) {
|
|||||||
<TableRowCell>
|
<TableRowCell>
|
||||||
{customFormats?.length ? (
|
{customFormats?.length ? (
|
||||||
<Popover
|
<Popover
|
||||||
anchor={formatCustomFormatScore(customFormatScore)}
|
anchor={formatCustomFormatScore(
|
||||||
|
customFormatScore,
|
||||||
|
customFormats.length
|
||||||
|
)}
|
||||||
title={translate('CustomFormats')}
|
title={translate('CustomFormats')}
|
||||||
body={
|
body={
|
||||||
<div className={styles.customFormatTooltip}>
|
<div className={styles.customFormatTooltip}>
|
||||||
|
@ -23,6 +23,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
|
|||||||
public string ReleaseGroup { get; set; }
|
public string ReleaseGroup { get; set; }
|
||||||
public string DownloadId { get; set; }
|
public string DownloadId { get; set; }
|
||||||
public List<CustomFormat> CustomFormats { get; set; }
|
public List<CustomFormat> CustomFormats { get; set; }
|
||||||
|
public int CustomFormatScore { get; set; }
|
||||||
public IEnumerable<Rejection> Rejections { get; set; }
|
public IEnumerable<Rejection> Rejections { get; set; }
|
||||||
|
|
||||||
public ManualImportItem()
|
public ManualImportItem()
|
||||||
|
@ -393,6 +393,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual
|
|||||||
item.Series = decision.LocalEpisode.Series;
|
item.Series = decision.LocalEpisode.Series;
|
||||||
|
|
||||||
item.CustomFormats = _formatCalculator.ParseCustomFormat(decision.LocalEpisode);
|
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)
|
if (decision.LocalEpisode.Episodes.Any() && decision.LocalEpisode.Episodes.Select(c => c.SeasonNumber).Distinct().Count() == 1)
|
||||||
|
@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions;
|
|||||||
using NzbDrone.Core.Languages;
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.MediaFiles.EpisodeImport.Manual;
|
using NzbDrone.Core.MediaFiles.EpisodeImport.Manual;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
using Sonarr.Api.V3.CustomFormats;
|
||||||
using Sonarr.Api.V3.Episodes;
|
using Sonarr.Api.V3.Episodes;
|
||||||
using Sonarr.Http;
|
using Sonarr.Http;
|
||||||
|
|
||||||
@ -43,6 +44,8 @@ namespace Sonarr.Api.V3.ManualImport
|
|||||||
item.SeasonNumber = processedItem.SeasonNumber;
|
item.SeasonNumber = processedItem.SeasonNumber;
|
||||||
item.Episodes = processedItem.Episodes.ToResource();
|
item.Episodes = processedItem.Episodes.ToResource();
|
||||||
item.Rejections = processedItem.Rejections;
|
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.
|
// 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.
|
// 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.
|
||||||
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
|||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
using NzbDrone.Core.Languages;
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
using Sonarr.Api.V3.CustomFormats;
|
||||||
using Sonarr.Api.V3.Episodes;
|
using Sonarr.Api.V3.Episodes;
|
||||||
using Sonarr.Http.REST;
|
using Sonarr.Http.REST;
|
||||||
|
|
||||||
@ -18,7 +19,8 @@ namespace Sonarr.Api.V3.ManualImport
|
|||||||
public List<Language> Languages { get; set; }
|
public List<Language> Languages { get; set; }
|
||||||
public string ReleaseGroup { get; set; }
|
public string ReleaseGroup { get; set; }
|
||||||
public string DownloadId { get; set; }
|
public string DownloadId { get; set; }
|
||||||
|
public List<CustomFormatResource> CustomFormats { get; set; }
|
||||||
|
public int CustomFormatScore { get; set; }
|
||||||
public IEnumerable<Rejection> Rejections { get; set; }
|
public IEnumerable<Rejection> Rejections { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user