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

@@ -294,13 +294,13 @@ namespace MediaBrowser.Model.Dto
public NameGuidPair[] GenreItems { get; set; }
/// <summary>
/// If the item does not have a logo, this will hold the Id of the Parent that has one.
/// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent logo item id.</value>
public string ParentLogoItemId { get; set; }
/// <summary>
/// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
/// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent backdrop item id.</value>
public string ParentBackdropItemId { get; set; }
@@ -318,7 +318,7 @@ namespace MediaBrowser.Model.Dto
public int? LocalTrailerCount { get; set; }
/// <summary>
/// User data for this item based on the user it's being requested for.
/// Gets or sets the user data for this item based on the user it's being requested for.
/// </summary>
/// <value>The user data.</value>
public UserItemDataDto UserData { get; set; }
@@ -506,7 +506,7 @@ namespace MediaBrowser.Model.Dto
public string ParentLogoImageTag { get; set; }
/// <summary>
/// If the item does not have a art, this will hold the Id of the Parent that has one.
/// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent art item id.</value>
public string ParentArtItemId { get; set; }
@@ -695,7 +695,7 @@ namespace MediaBrowser.Model.Dto
public string ChannelPrimaryImageTag { get; set; }
/// <summary>
/// The start date of the recording, in UTC.
/// Gets or sets the start date of the recording, in UTC.
/// </summary>
public DateTime? StartDate { get; set; }

View File

@@ -12,6 +12,18 @@ namespace MediaBrowser.Model.Dto
{
public class MediaSourceInfo
{
public MediaSourceInfo()
{
Formats = Array.Empty<string>();
MediaStreams = new List<MediaStream>();
MediaAttachments = Array.Empty<MediaAttachment>();
RequiredHttpHeaders = new Dictionary<string, string>();
SupportsTranscoding = true;
SupportsDirectStream = true;
SupportsDirectPlay = true;
SupportsProbing = true;
}
public MediaProtocol Protocol { get; set; }
public string Id { get; set; }
@@ -31,6 +43,7 @@ namespace MediaBrowser.Model.Dto
public string Name { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the media is remote.
/// Differentiate internet url vs local network.
/// </summary>
public bool IsRemote { get; set; }
@@ -95,16 +108,28 @@ namespace MediaBrowser.Model.Dto
public int? AnalyzeDurationMs { get; set; }
public MediaSourceInfo()
[JsonIgnore]
public TranscodeReason[] TranscodeReasons { get; set; }
public int? DefaultAudioStreamIndex { get; set; }
public int? DefaultSubtitleStreamIndex { get; set; }
[JsonIgnore]
public MediaStream VideoStream
{
Formats = Array.Empty<string>();
MediaStreams = new List<MediaStream>();
MediaAttachments = Array.Empty<MediaAttachment>();
RequiredHttpHeaders = new Dictionary<string, string>();
SupportsTranscoding = true;
SupportsDirectStream = true;
SupportsDirectPlay = true;
SupportsProbing = true;
get
{
foreach (var i in MediaStreams)
{
if (i.Type == MediaStreamType.Video)
{
return i;
}
}
return null;
}
}
public void InferTotalBitrate(bool force = false)
@@ -134,13 +159,6 @@ namespace MediaBrowser.Model.Dto
}
}
[JsonIgnore]
public TranscodeReason[] TranscodeReasons { get; set; }
public int? DefaultAudioStreamIndex { get; set; }
public int? DefaultSubtitleStreamIndex { get; set; }
public MediaStream GetDefaultAudioStream(int? defaultIndex)
{
if (defaultIndex.HasValue)
@@ -175,23 +193,6 @@ namespace MediaBrowser.Model.Dto
return null;
}
[JsonIgnore]
public MediaStream VideoStream
{
get
{
foreach (var i in MediaStreams)
{
if (i.Type == MediaStreamType.Video)
{
return i;
}
}
return null;
}
}
public MediaStream GetMediaStream(MediaStreamType type, int index)
{
foreach (var i in MediaStreams)

View File

@@ -10,6 +10,15 @@ namespace MediaBrowser.Model.Dto
{
public class MetadataEditorInfo
{
public MetadataEditorInfo()
{
ParentalRatingOptions = Array.Empty<ParentalRating>();
Countries = Array.Empty<CountryInfo>();
Cultures = Array.Empty<CultureDto>();
ExternalIdInfos = Array.Empty<ExternalIdInfo>();
ContentTypeOptions = Array.Empty<NameValuePair>();
}
public ParentalRating[] ParentalRatingOptions { get; set; }
public CountryInfo[] Countries { get; set; }
@@ -21,14 +30,5 @@ namespace MediaBrowser.Model.Dto
public string ContentType { get; set; }
public NameValuePair[] ContentTypeOptions { get; set; }
public MetadataEditorInfo()
{
ParentalRatingOptions = Array.Empty<ParentalRating>();
Countries = Array.Empty<CountryInfo>();
Cultures = Array.Empty<CultureDto>();
ExternalIdInfos = Array.Empty<ExternalIdInfo>();
ContentTypeOptions = Array.Empty<NameValuePair>();
}
}
}

View File

@@ -0,0 +1,14 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Dto
{
public class NameGuidPair
{
public string Name { get; set; }
public Guid Id { get; set; }
}
}

View File

@@ -19,11 +19,4 @@ namespace MediaBrowser.Model.Dto
/// <value>The identifier.</value>
public string Id { get; set; }
}
public class NameGuidPair
{
public string Name { get; set; }
public Guid Id { get; set; }
}
}

View File

@@ -10,6 +10,15 @@ namespace MediaBrowser.Model.Dto
/// </summary>
public class UserDto : IItemDto, IHasServerId
{
/// <summary>
/// Initializes a new instance of the <see cref="UserDto"/> class.
/// </summary>
public UserDto()
{
Configuration = new UserConfiguration();
Policy = new UserPolicy();
}
/// <summary>
/// Gets or sets the name.
/// </summary>
@@ -94,15 +103,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The primary image aspect ratio.</value>
public double? PrimaryImageAspectRatio { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="UserDto"/> class.
/// </summary>
public UserDto()
{
Configuration = new UserConfiguration();
Policy = new UserPolicy();
}
/// <inheritdoc />
public override string ToString()
{