New: Show Custom Format score in Manual Import
This commit is contained in:
parent
5e19478266
commit
972e140899
|
@ -30,6 +30,8 @@ import {
|
|||
import { SelectStateInputProps } from 'typings/props';
|
||||
import Rejection from 'typings/Rejection';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import InteractiveImportRowCellPlaceholder from './InteractiveImportRowCellPlaceholder';
|
||||
import styles from './InteractiveImportRow.css';
|
||||
|
||||
|
@ -57,6 +59,7 @@ interface InteractiveImportRowProps {
|
|||
languages?: Language[];
|
||||
size: number;
|
||||
customFormats?: object[];
|
||||
customFormatScore?: number;
|
||||
rejections: Rejection[];
|
||||
columns: Column[];
|
||||
episodeFileId?: number;
|
||||
|
@ -80,6 +83,7 @@ function InteractiveImportRow(props: InteractiveImportRowProps) {
|
|||
releaseGroup,
|
||||
size,
|
||||
customFormats,
|
||||
customFormatScore,
|
||||
rejections,
|
||||
isReprocessing,
|
||||
isSelected,
|
||||
|
@ -427,8 +431,8 @@ function InteractiveImportRow(props: InteractiveImportRowProps) {
|
|||
<TableRowCell>
|
||||
{customFormats?.length ? (
|
||||
<Popover
|
||||
anchor={<Icon name={icons.INTERACTIVE} />}
|
||||
title="Formats"
|
||||
anchor={formatPreferredWordScore(customFormatScore)}
|
||||
title={translate('CustomFormats')}
|
||||
body={
|
||||
<div className={styles.customFormatTooltip}>
|
||||
<EpisodeFormats formats={customFormats} />
|
||||
|
|
|
@ -47,6 +47,10 @@ export const defaultState = {
|
|||
|
||||
quality: function(item, direction) {
|
||||
return item.qualityWeight || 0;
|
||||
},
|
||||
|
||||
customFormats: function(item, direction) {
|
||||
return item.customFormatScore;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Sonarr.Api.V3.ManualImport
|
|||
public int QualityWeight { get; set; }
|
||||
public string DownloadId { get; set; }
|
||||
public List<CustomFormatResource> CustomFormats { get; set; }
|
||||
public int CustomFormatScore { get; set; }
|
||||
public IEnumerable<Rejection> Rejections { get; set; }
|
||||
}
|
||||
|
||||
|
@ -41,6 +42,9 @@ namespace Sonarr.Api.V3.ManualImport
|
|||
return null;
|
||||
}
|
||||
|
||||
var customFormats = model.CustomFormats;
|
||||
var customFormatScore = model.Series?.QualityProfile?.Value?.CalculateCustomFormatScore(customFormats) ?? 0;
|
||||
|
||||
return new ManualImportResource
|
||||
{
|
||||
Id = HashConverter.GetHashInt31(model.Path),
|
||||
|
@ -56,7 +60,8 @@ namespace Sonarr.Api.V3.ManualImport
|
|||
ReleaseGroup = model.ReleaseGroup,
|
||||
Quality = model.Quality,
|
||||
Languages = model.Languages,
|
||||
CustomFormats = model.CustomFormats.ToResource(false),
|
||||
CustomFormats = customFormats.ToResource(false),
|
||||
CustomFormatScore = customFormatScore,
|
||||
|
||||
// QualityWeight
|
||||
DownloadId = model.DownloadId,
|
||||
|
|
Loading…
Reference in New Issue