mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-24 22:36:19 -04:00
StyleCop
This commit is contained in:
@@ -53,7 +53,6 @@ namespace Sonarr.Http.ClientSchema
|
||||
}
|
||||
|
||||
return target;
|
||||
|
||||
}
|
||||
|
||||
public static T ReadFromSchema<T>(List<Field> fields)
|
||||
@@ -61,7 +60,6 @@ namespace Sonarr.Http.ClientSchema
|
||||
return (T)ReadFromSchema(fields, typeof(T));
|
||||
}
|
||||
|
||||
|
||||
// Ideally this function should begin a System.Linq.Expression expression tree since it's faster.
|
||||
// But it's probably not needed till performance issues pop up.
|
||||
public static FieldMapping[] GetFieldMappings(Type type)
|
||||
@@ -81,6 +79,7 @@ namespace Sonarr.Http.ClientSchema
|
||||
|
||||
_mappings[type] = result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -189,32 +188,26 @@ namespace Sonarr.Http.ClientSchema
|
||||
{
|
||||
return fieldValue => fieldValue?.ToString().ParseInt32() ?? 0;
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(long))
|
||||
{
|
||||
return fieldValue => fieldValue?.ToString().ParseInt64() ?? 0;
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(double))
|
||||
{
|
||||
return fieldValue => fieldValue?.ToString().ParseDouble() ?? 0.0;
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(int?))
|
||||
{
|
||||
return fieldValue => fieldValue?.ToString().ParseInt32();
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(Int64?))
|
||||
else if (propertyType == typeof(long?))
|
||||
{
|
||||
return fieldValue => fieldValue?.ToString().ParseInt64();
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(double?))
|
||||
{
|
||||
return fieldValue => fieldValue?.ToString().ParseDouble();
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(IEnumerable<int>))
|
||||
{
|
||||
return fieldValue =>
|
||||
@@ -233,7 +226,6 @@ namespace Sonarr.Http.ClientSchema
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(IEnumerable<string>))
|
||||
{
|
||||
return fieldValue =>
|
||||
@@ -252,7 +244,6 @@ namespace Sonarr.Http.ClientSchema
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return fieldValue => fieldValue;
|
||||
@@ -261,7 +252,7 @@ namespace Sonarr.Http.ClientSchema
|
||||
|
||||
private static string GetCamelCaseName(string name)
|
||||
{
|
||||
return Char.ToLowerInvariant(name[0]) + name.Substring(1);
|
||||
return char.ToLowerInvariant(name[0]) + name.Substring(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user