mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 16:43:25 +01:00
Fixed: Allow decimals for Seed Ratio
This commit is contained in:
parent
68b895d2ad
commit
dd21d9b521
4 changed files with 4 additions and 2 deletions
|
|
@ -256,6 +256,7 @@ FormInputGroup.propTypes = {
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
value: PropTypes.any,
|
value: PropTypes.any,
|
||||||
values: PropTypes.arrayOf(PropTypes.any),
|
values: PropTypes.arrayOf(PropTypes.any),
|
||||||
|
isFloat: PropTypes.bool,
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
kind: PropTypes.oneOf(kinds.all),
|
kind: PropTypes.oneOf(kinds.all),
|
||||||
min: PropTypes.number,
|
min: PropTypes.number,
|
||||||
|
|
|
||||||
|
|
@ -224,6 +224,7 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
||||||
name="seedRatio"
|
name="seedRatio"
|
||||||
value={seedRatio}
|
value={seedRatio}
|
||||||
helpText={translate('SeedRatioHelpText')}
|
helpText={translate('SeedRatioHelpText')}
|
||||||
|
isFloat={true}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public class IndexerTorrentBaseSettings
|
||||||
[FieldDefinition(1, Type = FieldType.Number, Label = "IndexerSettingsAppsMinimumSeeders", HelpText = "IndexerSettingsAppsMinimumSeedersHelpText", Advanced = true)]
|
[FieldDefinition(1, Type = FieldType.Number, Label = "IndexerSettingsAppsMinimumSeeders", HelpText = "IndexerSettingsAppsMinimumSeedersHelpText", Advanced = true)]
|
||||||
public int? AppMinimumSeeders { get; set; }
|
public int? AppMinimumSeeders { get; set; }
|
||||||
|
|
||||||
[FieldDefinition(2, Type = FieldType.Textbox, Label = "IndexerSettingsSeedRatio", HelpText = "IndexerSettingsSeedRatioHelpText")]
|
[FieldDefinition(2, Type = FieldType.Number, Label = "IndexerSettingsSeedRatio", HelpText = "IndexerSettingsSeedRatioHelpText")]
|
||||||
public double? SeedRatio { get; set; }
|
public double? SeedRatio { get; set; }
|
||||||
|
|
||||||
[FieldDefinition(3, Type = FieldType.Number, Label = "IndexerSettingsSeedTime", Unit = "minutes", HelpText = "IndexerSettingsSeedTimeHelpText", Advanced = true)]
|
[FieldDefinition(3, Type = FieldType.Number, Label = "IndexerSettingsSeedTime", Unit = "minutes", HelpText = "IndexerSettingsSeedTimeHelpText", Advanced = true)]
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ private static FieldMapping[] GetFieldMapping(Type type, string prefix, Func<obj
|
||||||
field.Hidden = fieldAttribute.Hidden.ToString().FirstCharToLower();
|
field.Hidden = fieldAttribute.Hidden.ToString().FirstCharToLower();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldAttribute.Type is FieldType.Number && propertyInfo.PropertyType == typeof(double))
|
if (fieldAttribute.Type is FieldType.Number && (propertyInfo.PropertyType == typeof(double) || propertyInfo.PropertyType == typeof(double?)))
|
||||||
{
|
{
|
||||||
field.IsFloat = true;
|
field.IsFloat = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue