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

@@ -24,36 +24,4 @@ namespace MediaBrowser.Model.Entities
public const string Playlists = "playlists";
public const string Folders = "folders";
}
public static class SpecialFolder
{
public const string TvShowSeries = "TvShowSeries";
public const string TvGenres = "TvGenres";
public const string TvGenre = "TvGenre";
public const string TvLatest = "TvLatest";
public const string TvNextUp = "TvNextUp";
public const string TvResume = "TvResume";
public const string TvFavoriteSeries = "TvFavoriteSeries";
public const string TvFavoriteEpisodes = "TvFavoriteEpisodes";
public const string MovieLatest = "MovieLatest";
public const string MovieResume = "MovieResume";
public const string MovieMovies = "MovieMovies";
public const string MovieCollections = "MovieCollections";
public const string MovieFavorites = "MovieFavorites";
public const string MovieGenres = "MovieGenres";
public const string MovieGenre = "MovieGenre";
public const string MusicArtists = "MusicArtists";
public const string MusicAlbumArtists = "MusicAlbumArtists";
public const string MusicAlbums = "MusicAlbums";
public const string MusicGenres = "MusicGenres";
public const string MusicLatest = "MusicLatest";
public const string MusicPlaylists = "MusicPlaylists";
public const string MusicSongs = "MusicSongs";
public const string MusicFavorites = "MusicFavorites";
public const string MusicFavoriteArtists = "MusicFavoriteArtists";
public const string MusicFavoriteAlbums = "MusicFavoriteAlbums";
public const string MusicFavoriteSongs = "MusicFavoriteSongs";
}
}

View File

@@ -84,7 +84,7 @@ namespace MediaBrowser.Model.Entities
public string Title { get; set; }
/// <summary>
/// Gets or sets the video range.
/// Gets the video range.
/// </summary>
/// <value>The video range.</value>
public string VideoRange
@@ -108,11 +108,11 @@ namespace MediaBrowser.Model.Entities
}
}
public string localizedUndefined { get; set; }
public string LocalizedUndefined { get; set; }
public string localizedDefault { get; set; }
public string LocalizedDefault { get; set; }
public string localizedForced { get; set; }
public string LocalizedForced { get; set; }
public string DisplayTitle
{
@@ -154,7 +154,7 @@ namespace MediaBrowser.Model.Entities
if (IsDefault)
{
attributes.Add(string.IsNullOrEmpty(localizedDefault) ? "Default" : localizedDefault);
attributes.Add(string.IsNullOrEmpty(LocalizedDefault) ? "Default" : LocalizedDefault);
}
if (!string.IsNullOrEmpty(Title))
@@ -229,17 +229,17 @@ namespace MediaBrowser.Model.Entities
}
else
{
attributes.Add(string.IsNullOrEmpty(localizedUndefined) ? "Und" : localizedUndefined);
attributes.Add(string.IsNullOrEmpty(LocalizedUndefined) ? "Und" : LocalizedUndefined);
}
if (IsDefault)
{
attributes.Add(string.IsNullOrEmpty(localizedDefault) ? "Default" : localizedDefault);
attributes.Add(string.IsNullOrEmpty(LocalizedDefault) ? "Default" : LocalizedDefault);
}
if (IsForced)
{
attributes.Add(string.IsNullOrEmpty(localizedForced) ? "Forced" : localizedForced);
attributes.Add(string.IsNullOrEmpty(LocalizedForced) ? "Forced" : LocalizedForced);
}
if (!string.IsNullOrEmpty(Title))
@@ -266,67 +266,6 @@ namespace MediaBrowser.Model.Entities
}
}
private string GetResolutionText()
{
var i = this;
if (i.Width.HasValue && i.Height.HasValue)
{
var width = i.Width.Value;
var height = i.Height.Value;
if (width >= 3800 || height >= 2000)
{
return "4K";
}
if (width >= 2500)
{
if (i.IsInterlaced)
{
return "1440i";
}
return "1440p";
}
if (width >= 1900 || height >= 1000)
{
if (i.IsInterlaced)
{
return "1080i";
}
return "1080p";
}
if (width >= 1260 || height >= 700)
{
if (i.IsInterlaced)
{
return "720i";
}
return "720p";
}
if (width >= 700 || height >= 440)
{
if (i.IsInterlaced)
{
return "480i";
}
return "480p";
}
return "SD";
}
return null;
}
public string NalLengthSize { get; set; }
/// <summary>
@@ -487,6 +426,96 @@ namespace MediaBrowser.Model.Entities
}
}
/// <summary>
/// Gets or sets a value indicating whether [supports external stream].
/// </summary>
/// <value><c>true</c> if [supports external stream]; otherwise, <c>false</c>.</value>
public bool SupportsExternalStream { get; set; }
/// <summary>
/// Gets or sets the filename.
/// </summary>
/// <value>The filename.</value>
public string Path { get; set; }
/// <summary>
/// Gets or sets the pixel format.
/// </summary>
/// <value>The pixel format.</value>
public string PixelFormat { get; set; }
/// <summary>
/// Gets or sets the level.
/// </summary>
/// <value>The level.</value>
public double? Level { get; set; }
/// <summary>
/// Gets or sets whether this instance is anamorphic.
/// </summary>
/// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value>
public bool? IsAnamorphic { get; set; }
private string GetResolutionText()
{
var i = this;
if (i.Width.HasValue && i.Height.HasValue)
{
var width = i.Width.Value;
var height = i.Height.Value;
if (width >= 3800 || height >= 2000)
{
return "4K";
}
if (width >= 2500)
{
if (i.IsInterlaced)
{
return "1440i";
}
return "1440p";
}
if (width >= 1900 || height >= 1000)
{
if (i.IsInterlaced)
{
return "1080i";
}
return "1080p";
}
if (width >= 1260 || height >= 700)
{
if (i.IsInterlaced)
{
return "720i";
}
return "720p";
}
if (width >= 700 || height >= 440)
{
if (i.IsInterlaced)
{
return "480i";
}
return "480p";
}
return "SD";
}
return null;
}
public static bool IsTextFormat(string format)
{
string codec = format ?? string.Empty;
@@ -533,35 +562,5 @@ namespace MediaBrowser.Model.Entities
return true;
}
/// <summary>
/// Gets or sets a value indicating whether [supports external stream].
/// </summary>
/// <value><c>true</c> if [supports external stream]; otherwise, <c>false</c>.</value>
public bool SupportsExternalStream { get; set; }
/// <summary>
/// Gets or sets the filename.
/// </summary>
/// <value>The filename.</value>
public string Path { get; set; }
/// <summary>
/// Gets or sets the pixel format.
/// </summary>
/// <value>The pixel format.</value>
public string PixelFormat { get; set; }
/// <summary>
/// Gets or sets the level.
/// </summary>
/// <value>The level.</value>
public double? Level { get; set; }
/// <summary>
/// Gets a value indicating whether this instance is anamorphic.
/// </summary>
/// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value>
public bool? IsAnamorphic { get; set; }
}
}

View File

@@ -1,40 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Entities
{
public class PackageReviewInfo
{
/// <summary>
/// Gets or sets the package id (database key) for this review.
/// </summary>
public int id { get; set; }
/// <summary>
/// Gets or sets the rating value.
/// </summary>
public int rating { get; set; }
/// <summary>
/// Gets or sets whether or not this review recommends this item.
/// </summary>
public bool recommend { get; set; }
/// <summary>
/// Gets or sets a short description of the review.
/// </summary>
public string title { get; set; }
/// <summary>
/// Gets or sets the full review.
/// </summary>
public string review { get; set; }
/// <summary>
/// Gets or sets the time of review.
/// </summary>
public DateTime timestamp { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Entities
{
public static class SpecialFolder
{
public const string TvShowSeries = "TvShowSeries";
public const string TvGenres = "TvGenres";
public const string TvGenre = "TvGenre";
public const string TvLatest = "TvLatest";
public const string TvNextUp = "TvNextUp";
public const string TvResume = "TvResume";
public const string TvFavoriteSeries = "TvFavoriteSeries";
public const string TvFavoriteEpisodes = "TvFavoriteEpisodes";
public const string MovieLatest = "MovieLatest";
public const string MovieResume = "MovieResume";
public const string MovieMovies = "MovieMovies";
public const string MovieCollections = "MovieCollections";
public const string MovieFavorites = "MovieFavorites";
public const string MovieGenres = "MovieGenres";
public const string MovieGenre = "MovieGenre";
public const string MusicArtists = "MusicArtists";
public const string MusicAlbumArtists = "MusicAlbumArtists";
public const string MusicAlbums = "MusicAlbums";
public const string MusicGenres = "MusicGenres";
public const string MusicLatest = "MusicLatest";
public const string MusicPlaylists = "MusicPlaylists";
public const string MusicSongs = "MusicSongs";
public const string MusicFavorites = "MusicFavorites";
public const string MusicFavoriteArtists = "MusicFavoriteArtists";
public const string MusicFavoriteAlbums = "MusicFavoriteAlbums";
public const string MusicFavoriteSongs = "MusicFavoriteSongs";
}
}

View File

@@ -11,6 +11,14 @@ namespace MediaBrowser.Model.Entities
/// </summary>
public class VirtualFolderInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="VirtualFolderInfo"/> class.
/// </summary>
public VirtualFolderInfo()
{
Locations = Array.Empty<string>();
}
/// <summary>
/// Gets or sets the name.
/// </summary>
@@ -31,14 +39,6 @@ namespace MediaBrowser.Model.Entities
public LibraryOptions LibraryOptions { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="VirtualFolderInfo"/> class.
/// </summary>
public VirtualFolderInfo()
{
Locations = Array.Empty<string>();
}
/// <summary>
/// Gets or sets the item identifier.
/// </summary>