mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
SeriesProvider is now Subsonic free.
This commit is contained in:
parent
63f6899894
commit
cb8cb1691f
10 changed files with 195 additions and 140 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue