diff --git a/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs b/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs index 03161e5109..095ed6b41b 100644 --- a/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs +++ b/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs @@ -73,14 +73,26 @@ public static object ReadFormSchema(List fields, Type targetType) if (propertyInfo.PropertyType == typeof(Int32)) { - var intValue = Convert.ToInt32(field.Value); - propertyInfo.SetValue(target, intValue, null); + var value = Convert.ToInt32(field.Value); + propertyInfo.SetValue(target, value, null); + } + + if (propertyInfo.PropertyType == typeof(Int64)) + { + var value = Convert.ToInt64(field.Value); + propertyInfo.SetValue(target, value, null); } else if (propertyInfo.PropertyType == typeof(Nullable)) { - var intValue = field.Value.ToString().ParseInt32(); - propertyInfo.SetValue(target, intValue, null); + var value = field.Value.ToString().ParseInt32(); + propertyInfo.SetValue(target, value, null); + } + + else if (propertyInfo.PropertyType == typeof(Nullable)) + { + var value = field.Value.ToString().ParseInt64(); + propertyInfo.SetValue(target, value, null); } else diff --git a/src/NzbDrone.Common/TryParseExtension.cs b/src/NzbDrone.Common/TryParseExtension.cs index 008bf5b7c7..aea829ce25 100644 --- a/src/NzbDrone.Common/TryParseExtension.cs +++ b/src/NzbDrone.Common/TryParseExtension.cs @@ -15,5 +15,17 @@ public static Nullable ParseInt32(this string source) return null; } + + public static Nullable ParseInt64(this string source) + { + Int64 result = 0; + + if (Int64.TryParse(source, out result)) + { + return result; + } + + return null; + } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Notifications/PushBullet/TestPushBulletCommand.cs b/src/NzbDrone.Core/Notifications/PushBullet/TestPushBulletCommand.cs index 715be4661d..e4fe19e832 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/TestPushBulletCommand.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/TestPushBulletCommand.cs @@ -13,6 +13,6 @@ public override bool SendUpdatesToClient } } public string ApiKey { get; set; } - public int DeviceId { get; set; } + public long DeviceId { get; set; } } }