Merge branch 'master' into NetworkPR2

This commit is contained in:
BaronGreenback
2020-11-16 16:27:37 +00:00
committed by GitHub
255 changed files with 2073 additions and 2152 deletions

View File

@@ -9,6 +9,10 @@ namespace MediaBrowser.Model.Configuration
public string TranscodingTempPath { get; set; }
public string FallbackFontPath { get; set; }
public bool EnableFallbackFont { get; set; }
public double DownMixAudioBoost { get; set; }
public int MaxMuxingQueueSize { get; set; }
@@ -69,6 +73,7 @@ namespace MediaBrowser.Model.Configuration
public EncodingOptions()
{
EnableFallbackFont = false;
DownMixAudioBoost = 2;
MaxMuxingQueueSize = 2048;
EnableThrottling = false;

View File

@@ -17,8 +17,6 @@ namespace MediaBrowser.Model.Configuration
public bool ExtractChapterImagesDuringLibraryScan { get; set; }
public bool DownloadImagesInAdvance { get; set; }
public MediaPathInfo[] PathInfos { get; set; }
public bool SaveLocalMetadata { get; set; }

View File

@@ -49,7 +49,7 @@ namespace MediaBrowser.Model.Dlna
/// <summary>
/// The application's configured quality setting.
/// </summary>
public long? MaxBitrate { get; set; }
public int? MaxBitrate { get; set; }
/// <summary>
/// Gets or sets the context.
@@ -67,7 +67,7 @@ namespace MediaBrowser.Model.Dlna
/// Gets the maximum bitrate.
/// </summary>
/// <returns>System.Nullable&lt;System.Int32&gt;.</returns>
public long? GetMaxBitrate(bool isAudio)
public int? GetMaxBitrate(bool isAudio)
{
if (MaxBitrate.HasValue)
{

View File

@@ -34,7 +34,7 @@ namespace MediaBrowser.Model.Dlna
return Array.Empty<string>();
}
return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return value.Split(',', StringSplitOptions.RemoveEmptyEntries);
}
public bool ContainsContainer(string container)

View File

@@ -186,7 +186,7 @@ namespace MediaBrowser.Model.Dlna
if (mediaProfile != null && !string.IsNullOrEmpty(mediaProfile.OrgPn))
{
orgPnValues.AddRange(mediaProfile.OrgPn.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
orgPnValues.AddRange(mediaProfile.OrgPn.Split(',', StringSplitOptions.RemoveEmptyEntries));
}
else
{

View File

@@ -62,9 +62,9 @@ namespace MediaBrowser.Model.Dlna
public int? MaxIconHeight { get; set; }
public long? MaxStreamingBitrate { get; set; }
public int? MaxStreamingBitrate { get; set; }
public long? MaxStaticBitrate { get; set; }
public int? MaxStaticBitrate { get; set; }
public int? MusicStreamingTranscodingBitrate { get; set; }

View File

@@ -1647,7 +1647,7 @@ namespace MediaBrowser.Model.Dlna
// strip spaces to avoid having to encode
var values = value
.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
.Split('|', StringSplitOptions.RemoveEmptyEntries);
if (condition.Condition == ProfileConditionType.Equals || condition.Condition == ProfileConditionType.EqualsAny)
{

View File

@@ -191,6 +191,11 @@ namespace MediaBrowser.Model.Entities
attributes.Add(Codec.ToUpperInvariant());
}
if (!string.IsNullOrEmpty(VideoRange))
{
attributes.Add(VideoRange.ToUpperInvariant());
}
if (!string.IsNullOrEmpty(Title))
{
var result = new StringBuilder(Title);

View File

@@ -48,7 +48,7 @@ namespace MediaBrowser.Model.Entities
return null;
}
instance.ProviderIds.TryGetValue(name, out string id);
instance.ProviderIds.TryGetValue(name, out string? id);
return id;
}

View File

@@ -22,11 +22,6 @@ namespace MediaBrowser.Model.Extensions
return str;
}
#if NETSTANDARD2_0
char[] a = str.ToCharArray();
a[0] = char.ToUpperInvariant(a[0]);
return new string(a);
#else
return string.Create(
str.Length,
str,
@@ -38,7 +33,6 @@ namespace MediaBrowser.Model.Extensions
chars[i] = buf[i];
}
});
#endif
}
}
}

View File

@@ -14,7 +14,7 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' ">true</TreatWarningsAsErrors>
@@ -32,11 +32,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.9" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="System.Globalization" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="5.0.0-preview.8.20407.11" />
<PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -2,6 +2,7 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Model.MediaInfo
@@ -37,7 +38,7 @@ namespace MediaBrowser.Model.MediaInfo
public string PlaySessionId { get; set; }
public long? MaxStreamingBitrate { get; set; }
public int? MaxStreamingBitrate { get; set; }
public long? StartTimeTicks { get; set; }
@@ -55,6 +56,6 @@ namespace MediaBrowser.Model.MediaInfo
public bool EnableDirectStream { get; set; }
public MediaProtocol[] DirectPlayProtocols { get; set; }
public IReadOnlyList<MediaProtocol> DirectPlayProtocols { get; set; }
}
}

View File

@@ -1,42 +0,0 @@
using System;
using System.Net;
namespace MediaBrowser.Model.Net
{
/// <summary>
/// Class HttpException.
/// </summary>
public class HttpException : Exception
{
/// <summary>
/// Gets or sets the status code.
/// </summary>
/// <value>The status code.</value>
public HttpStatusCode? StatusCode { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is timed out.
/// </summary>
/// <value><c>true</c> if this instance is timed out; otherwise, <c>false</c>.</value>
public bool IsTimedOut { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="HttpException" /> class.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="innerException">The inner exception.</param>
public HttpException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HttpException" /> class.
/// </summary>
/// <param name="message">The message.</param>
public HttpException(string message)
: base(message)
{
}
}
}

View File

@@ -177,7 +177,7 @@ namespace MediaBrowser.Model.Net
var ext = Path.GetExtension(path);
if (_mimeTypeLookup.TryGetValue(ext, out string result))
if (_mimeTypeLookup.TryGetValue(ext, out string? result))
{
return result;
}
@@ -210,9 +210,9 @@ namespace MediaBrowser.Model.Net
return enableStreamDefault ? "application/octet-stream" : null;
}
public static string? ToExtension(string mimeType)
public static string? ToExtension(string? mimeType)
{
if (mimeType.Length == 0)
if (string.IsNullOrEmpty(mimeType))
{
throw new ArgumentException("String can't be empty.", nameof(mimeType));
}
@@ -220,7 +220,7 @@ namespace MediaBrowser.Model.Net
// handle text/html; charset=UTF-8
mimeType = mimeType.Split(';')[0];
if (_extensionLookup.TryGetValue(mimeType, out string result))
if (_extensionLookup.TryGetValue(mimeType, out string? result))
{
return result;
}

View File

@@ -0,0 +1,34 @@
using System;
namespace MediaBrowser.Model.Subtitles
{
/// <summary>
/// Class FontFile.
/// </summary>
public class FontFile
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string? Name { get; set; }
/// <summary>
/// Gets or sets the size.
/// </summary>
/// <value>The size.</value>
public long Size { get; set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
/// <value>The date created.</value>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
/// <value>The date modified.</value>
public DateTime DateModified { get; set; }
}
}