Fixed: Allow decimals for Custom Format size

Closes #5809
pull/5942/head
Mark McDowall 10 months ago
parent 566fae9d58
commit 7f5ddff568

@ -41,7 +41,7 @@ class NumberInput extends Component {
componentDidUpdate(prevProps, prevState) {
const { value } = this.props;
if (value !== prevProps.value && !this.state.isFocused) {
if (!isNaN(value) && value !== prevProps.value && !this.state.isFocused) {
this.setState({
value: value == null ? '' : value.toString()
});

@ -4,6 +4,7 @@ export const CHECK = 'check';
export const DEVICE = 'device';
export const KEY_VALUE_LIST = 'keyValueList';
export const MONITOR_EPISODES_SELECT = 'monitorEpisodesSelect';
export const FLOAT = 'float';
export const NUMBER = 'number';
export const OAUTH = 'oauth';
export const PASSWORD = 'password';
@ -30,6 +31,7 @@ export const all = [
DEVICE,
KEY_VALUE_LIST,
MONITOR_EPISODES_SELECT,
FLOAT,
NUMBER,
OAUTH,
PASSWORD,

@ -21,6 +21,7 @@ namespace Sonarr.Http.ClientSchema
public string Hidden { get; set; }
public PrivacyLevel Privacy { get; set; }
public string Placeholder { get; set; }
public bool IsFloat { get; set; }
public Field Clone()
{

@ -140,6 +140,11 @@ namespace Sonarr.Http.ClientSchema
field.Hidden = fieldAttribute.Hidden.ToString().FirstCharToLower();
}
if (fieldAttribute.Type is FieldType.Number && propertyInfo.PropertyType == typeof(double))
{
field.IsFloat = true;
}
var valueConverter = GetValueConverter(propertyInfo.PropertyType);
result.Add(new FieldMapping

Loading…
Cancel
Save