mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
ReSharper format: conform inline 'out' parameters.
This commit is contained in:
@@ -114,9 +114,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
var dateText = result.ToString();
|
||||
|
||||
DateTime dateTimeResult;
|
||||
|
||||
if (DateTime.TryParseExact(dateText, _datetimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out dateTimeResult))
|
||||
if (DateTime.TryParseExact(dateText, _datetimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out var dateTimeResult))
|
||||
{
|
||||
return dateTimeResult.ToUniversalTime();
|
||||
}
|
||||
@@ -201,8 +199,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, double value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
@@ -214,8 +211,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, string value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
@@ -234,8 +230,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, bool value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
@@ -247,8 +242,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, float value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
@@ -260,8 +254,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, int value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
@@ -273,8 +266,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, Guid value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value.ToGuidBlob());
|
||||
}
|
||||
@@ -286,8 +278,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, DateTime value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value.ToDateTimeParamValue());
|
||||
}
|
||||
@@ -299,8 +290,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, long value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
@@ -312,8 +302,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBind(this IStatement statement, string name, byte[] value)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.Bind(value);
|
||||
}
|
||||
@@ -325,8 +314,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void TryBindNull(this IStatement statement, string name)
|
||||
{
|
||||
IBindParameter bindParam;
|
||||
if (statement.BindParameters.TryGetValue(name, out bindParam))
|
||||
if (statement.BindParameters.TryGetValue(name, out var bindParam))
|
||||
{
|
||||
bindParam.BindNull();
|
||||
}
|
||||
|
||||
@@ -1164,25 +1164,21 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
image.Path = RestorePath(parts[0]);
|
||||
|
||||
long ticks;
|
||||
if (long.TryParse(parts[1], NumberStyles.Any, CultureInfo.InvariantCulture, out ticks))
|
||||
if (long.TryParse(parts[1], NumberStyles.Any, CultureInfo.InvariantCulture, out var ticks))
|
||||
{
|
||||
image.DateModified = new DateTime(ticks, DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
ImageType type;
|
||||
if (Enum.TryParse(parts[2], true, out type))
|
||||
if (Enum.TryParse(parts[2], true, out ImageType type))
|
||||
{
|
||||
image.Type = type;
|
||||
}
|
||||
|
||||
if (parts.Length >= 5)
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
if (int.TryParse(parts[3], NumberStyles.Integer, CultureInfo.InvariantCulture, out width))
|
||||
if (int.TryParse(parts[3], NumberStyles.Integer, CultureInfo.InvariantCulture, out var width))
|
||||
{
|
||||
if (int.TryParse(parts[4], NumberStyles.Integer, CultureInfo.InvariantCulture, out height))
|
||||
if (int.TryParse(parts[4], NumberStyles.Integer, CultureInfo.InvariantCulture, out var height))
|
||||
{
|
||||
image.Width = width;
|
||||
image.Height = height;
|
||||
@@ -1589,8 +1585,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
if (!reader.IsDBNull(index))
|
||||
{
|
||||
ProgramAudio audio;
|
||||
if (Enum.TryParse(reader.GetString(index), true, out audio))
|
||||
if (Enum.TryParse(reader.GetString(index), true, out ProgramAudio audio))
|
||||
{
|
||||
item.Audio = audio;
|
||||
}
|
||||
@@ -1634,9 +1629,7 @@ namespace Emby.Server.Implementations.Data
|
||||
item.LockedFields = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(
|
||||
i =>
|
||||
{
|
||||
MetadataFields parsedValue;
|
||||
|
||||
if (Enum.TryParse(i, true, out parsedValue))
|
||||
if (Enum.TryParse(i, true, out MetadataFields parsedValue))
|
||||
{
|
||||
return parsedValue;
|
||||
}
|
||||
@@ -1674,9 +1667,7 @@ namespace Emby.Server.Implementations.Data
|
||||
trailer.TrailerTypes = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(
|
||||
i =>
|
||||
{
|
||||
TrailerType parsedValue;
|
||||
|
||||
if (Enum.TryParse(i, true, out parsedValue))
|
||||
if (Enum.TryParse(i, true, out TrailerType parsedValue))
|
||||
{
|
||||
return parsedValue;
|
||||
}
|
||||
@@ -1857,8 +1848,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
if (!reader.IsDBNull(index))
|
||||
{
|
||||
ExtraType extraType;
|
||||
if (Enum.TryParse(reader.GetString(index), true, out extraType))
|
||||
if (Enum.TryParse(reader.GetString(index), true, out ExtraType extraType))
|
||||
{
|
||||
item.ExtraType = extraType;
|
||||
}
|
||||
@@ -5149,8 +5139,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
|
||||
private IEnumerable<string> MapIncludeItemTypes(string value)
|
||||
{
|
||||
string[] result;
|
||||
if (_types.TryGetValue(value, out result))
|
||||
if (_types.TryGetValue(value, out var result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user