Merge pull request #21 from jellyfin/master

nightly
This commit is contained in:
artiume
2020-02-23 10:57:52 -05:00
committed by GitHub
80 changed files with 833 additions and 1393 deletions

View File

@@ -1,39 +1,46 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Globalization;
namespace MediaBrowser.Model.Drawing
{
/// <summary>
/// Struct ImageDimensions.
/// </summary>
public struct ImageDimensions
public readonly struct ImageDimensions
{
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
public int Height { get; set; }
public ImageDimensions(int width, int height)
{
Width = width;
Height = height;
}
/// <summary>
/// Gets or sets the width.
/// Gets the height.
/// </summary>
/// <value>The height.</value>
public int Height { get; }
/// <summary>
/// Gets the width.
/// </summary>
/// <value>The width.</value>
public int Width { get; set; }
public int Width { get; }
public bool Equals(ImageDimensions size)
{
return Width.Equals(size.Width) && Height.Equals(size.Height);
}
/// <inheritdoc />
public override string ToString()
{
return string.Format("{0}-{1}", Width, Height);
}
public ImageDimensions(int width, int height)
{
Width = width;
Height = height;
return string.Format(
CultureInfo.InvariantCulture,
"{0}-{1}",
Width,
Height);
}
}
}

View File

@@ -30,5 +30,11 @@ namespace MediaBrowser.Model.Querying
{
Items = Array.Empty<T>();
}
public QueryResult(IReadOnlyList<T> items)
{
Items = items;
TotalRecordCount = items.Count;
}
}
}