Enable TreatWarningsAsErrors for MediaBrowser.Model

This commit is contained in:
Bond_009
2021-02-20 23:13:04 +01:00
parent 13d65318eb
commit 141efafd3d
98 changed files with 1800 additions and 1784 deletions

View File

@@ -7,6 +7,11 @@ namespace MediaBrowser.Model.Querying
{
public class EpisodeQuery
{
public EpisodeQuery()
{
Fields = Array.Empty<ItemFields>();
}
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
@@ -66,10 +71,5 @@ namespace MediaBrowser.Model.Querying
/// </summary>
/// <value>The start item identifier.</value>
public string StartItemId { get; set; }
public EpisodeQuery()
{
Fields = Array.Empty<ItemFields>();
}
}
}

View File

@@ -14,31 +14,32 @@ namespace MediaBrowser.Model.Querying
}
/// <summary>
/// The user to localize search results for.
/// Gets or sets the user to localize search results for.
/// </summary>
/// <value>The user id.</value>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the parent id.
/// Specify this to localize the search to a specific item or folder. Omit to use the root.
/// </summary>
/// <value>The parent id.</value>
public Guid ParentId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// Gets or sets the start index. Used for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return.
/// Gets or sets the maximum number of items to return.
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Fields to return within the items, in addition to basic information.
/// Gets or sets the fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }

View File

@@ -7,6 +7,13 @@ namespace MediaBrowser.Model.Querying
{
public class MovieRecommendationQuery
{
public MovieRecommendationQuery()
{
ItemLimit = 10;
CategoryLimit = 6;
Fields = Array.Empty<ItemFields>();
}
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
@@ -36,12 +43,5 @@ namespace MediaBrowser.Model.Querying
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
public MovieRecommendationQuery()
{
ItemLimit = 10;
CategoryLimit = 6;
Fields = Array.Empty<ItemFields>();
}
}
}

View File

@@ -8,6 +8,13 @@ namespace MediaBrowser.Model.Querying
{
public class NextUpQuery
{
public NextUpQuery()
{
EnableImageTypes = Array.Empty<ImageType>();
EnableTotalRecordCount = true;
DisableFirstEpisode = false;
}
/// <summary>
/// Gets or sets the user id.
/// </summary>
@@ -27,19 +34,19 @@ namespace MediaBrowser.Model.Querying
public string SeriesId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// Gets or sets the start index. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return.
/// Gets or sets the maximum number of items to return.
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Fields to return within the items, in addition to basic information.
/// gets or sets the fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
@@ -68,12 +75,5 @@ namespace MediaBrowser.Model.Querying
/// Gets or sets a value indicating whether do disable sending first episode as next up.
/// </summary>
public bool DisableFirstEpisode { get; set; }
public NextUpQuery()
{
EnableImageTypes = Array.Empty<ImageType>();
EnableTotalRecordCount = true;
DisableFirstEpisode = false;
}
}
}

View File

@@ -6,35 +6,16 @@ using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Querying
{
public class QueryFiltersLegacy
{
public string[] Genres { get; set; }
public string[] Tags { get; set; }
public string[] OfficialRatings { get; set; }
public int[] Years { get; set; }
public QueryFiltersLegacy()
{
Genres = Array.Empty<string>();
Tags = Array.Empty<string>();
OfficialRatings = Array.Empty<string>();
Years = Array.Empty<int>();
}
}
public class QueryFilters
{
public NameGuidPair[] Genres { get; set; }
public string[] Tags { get; set; }
public QueryFilters()
{
Tags = Array.Empty<string>();
Genres = Array.Empty<NameGuidPair>();
}
public NameGuidPair[] Genres { get; set; }
public string[] Tags { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Querying
{
public class QueryFiltersLegacy
{
public QueryFiltersLegacy()
{
Genres = Array.Empty<string>();
Tags = Array.Empty<string>();
OfficialRatings = Array.Empty<string>();
Years = Array.Empty<int>();
}
public string[] Genres { get; set; }
public string[] Tags { get; set; }
public string[] OfficialRatings { get; set; }
public int[] Years { get; set; }
}
}

View File

@@ -8,24 +8,6 @@ namespace MediaBrowser.Model.Querying
{
public class QueryResult<T>
{
/// <summary>
/// Gets or sets the items.
/// </summary>
/// <value>The items.</value>
public IReadOnlyList<T> Items { get; set; }
/// <summary>
/// The total number of records available.
/// </summary>
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
/// <summary>
/// The index of the first record in Items.
/// </summary>
/// <value>First record index.</value>
public int StartIndex { get; set; }
public QueryResult()
{
Items = Array.Empty<T>();
@@ -36,5 +18,23 @@ namespace MediaBrowser.Model.Querying
Items = items;
TotalRecordCount = items.Count;
}
/// <summary>
/// Gets or sets the items.
/// </summary>
/// <value>The items.</value>
public IReadOnlyList<T> Items { get; set; }
/// <summary>
/// Gets or sets the total number of records available.
/// </summary>
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
/// <summary>
/// Gets or sets the index of the first record in Items.
/// </summary>
/// <value>First record index.</value>
public int StartIndex { get; set; }
}
}

View File

@@ -8,6 +8,11 @@ namespace MediaBrowser.Model.Querying
{
public class UpcomingEpisodesQuery
{
public UpcomingEpisodesQuery()
{
EnableImageTypes = Array.Empty<ImageType>();
}
/// <summary>
/// Gets or sets the user id.
/// </summary>
@@ -21,19 +26,19 @@ namespace MediaBrowser.Model.Querying
public string ParentId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// Gets or sets the start index. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return.
/// Gets or sets the maximum number of items to return.
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Fields to return within the items, in addition to basic information.
/// Gets or sets the fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
@@ -55,10 +60,5 @@ namespace MediaBrowser.Model.Querying
/// </summary>
/// <value>The enable image types.</value>
public ImageType[] EnableImageTypes { get; set; }
public UpcomingEpisodesQuery()
{
EnableImageTypes = Array.Empty<ImageType>();
}
}
}