mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Reformat and apply Stylecop rules
This commit is contained in:
@@ -50,7 +50,6 @@ namespace Radarr.Http.ClientSchema
|
||||
}
|
||||
|
||||
return target;
|
||||
|
||||
}
|
||||
|
||||
public static T ReadFromSchema<T>(List<Field> fields)
|
||||
@@ -58,7 +57,6 @@ namespace Radarr.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)
|
||||
@@ -78,6 +76,7 @@ namespace Radarr.Http.ClientSchema
|
||||
|
||||
_mappings[type] = result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -156,32 +155,26 @@ namespace Radarr.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 =>
|
||||
@@ -196,7 +189,6 @@ namespace Radarr.Http.ClientSchema
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
else if (propertyType == typeof(IEnumerable<string>))
|
||||
{
|
||||
return fieldValue =>
|
||||
@@ -211,7 +203,6 @@ namespace Radarr.Http.ClientSchema
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return fieldValue => fieldValue;
|
||||
@@ -220,7 +211,7 @@ namespace Radarr.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