SeriesProvider is now Subsonic free.

This commit is contained in:
kay.one 2011-06-15 23:33:01 -07:00
commit cb8cb1691f
10 changed files with 195 additions and 140 deletions

View file

@ -11,7 +11,8 @@ namespace NzbDrone.Core.Datastore
if ((SourceType == typeof(Int32) || SourceType == typeof(Int64)) && destinationInfo.Type.IsGenericType && destinationInfo.Type.GetGenericTypeDefinition() == typeof(Nullable<>))
{
// If it is NULLABLE, then get the underlying type. eg if "Nullable<int>" then this will return just "int"
if (destinationInfo.Type.GetGenericArguments()[0].IsEnum)
Type genericArgument = destinationInfo.Type.GetGenericArguments()[0];
if (genericArgument == typeof(DayOfWeek))
{
return delegate(object s)
{
@ -25,6 +26,20 @@ namespace NzbDrone.Core.Datastore
return (Nullable<DayOfWeek>)value;
};
}
else
{
return delegate(object s)
{
int value;
Int32.TryParse(s.ToString(), out value);
if (value == 0)
{
return null;
}
return value;
};
}
}
return base.GetFromDbConverter(destinationInfo, SourceType);