mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-23 02:24:44 +01:00
Merge branch 'master' into syncplay-enhanced
This commit is contained in:
@@ -16,5 +16,12 @@ namespace MediaBrowser.Model.Activity
|
||||
Task CreateAsync(ActivityLog entry);
|
||||
|
||||
Task<QueryResult<ActivityLogEntry>> GetPagedResultAsync(ActivityLogQuery query);
|
||||
|
||||
/// <summary>
|
||||
/// Remove all activity logs before the specified date.
|
||||
/// </summary>
|
||||
/// <param name="startDate">Activity log start date.</param>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
Task CleanAsync(DateTime startDate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
@@ -63,12 +67,15 @@ namespace MediaBrowser.Model.Configuration
|
||||
|
||||
public bool EnableHardwareEncoding { get; set; }
|
||||
|
||||
public bool AllowHevcEncoding { get; set; }
|
||||
|
||||
public bool EnableSubtitleExtraction { get; set; }
|
||||
|
||||
public string[] HardwareDecodingCodecs { get; set; }
|
||||
|
||||
public EncodingOptions()
|
||||
{
|
||||
EnableFallbackFont = false;
|
||||
DownMixAudioBoost = 2;
|
||||
MaxMuxingQueueSize = 2048;
|
||||
EnableThrottling = false;
|
||||
@@ -94,6 +101,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
EnableDecodingColorDepth10Hevc = true;
|
||||
EnableDecodingColorDepth10Vp9 = true;
|
||||
EnableHardwareEncoding = true;
|
||||
AllowHevcEncoding = true;
|
||||
EnableSubtitleExtraction = true;
|
||||
HardwareDecodingCodecs = new string[] { "h264", "vc1" };
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
20
MediaBrowser.Model/Configuration/PathSubstitution.cs
Normal file
20
MediaBrowser.Model/Configuration/PathSubstitution.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#nullable enable
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="PathSubstitution" />.
|
||||
/// </summary>
|
||||
public class PathSubstitution
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the value to substitute.
|
||||
/// </summary>
|
||||
public string From { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value to substitution with.
|
||||
/// </summary>
|
||||
public string To { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
#pragma warning disable CA1819
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,321 +13,23 @@ namespace MediaBrowser.Model.Configuration
|
||||
/// </summary>
|
||||
public class ServerConfiguration : BaseApplicationConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// The default value for <see cref="HttpServerPortNumber"/>.
|
||||
/// </summary>
|
||||
public const int DefaultHttpPort = 8096;
|
||||
|
||||
/// <summary>
|
||||
/// The default value for <see cref="PublicHttpsPort"/> and <see cref="HttpsPortNumber"/>.
|
||||
/// </summary>
|
||||
public const int DefaultHttpsPort = 8920;
|
||||
private string _baseUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to enable automatic port forwarding.
|
||||
/// </summary>
|
||||
public bool EnableUPnP { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to enable prometheus metrics exporting.
|
||||
/// </summary>
|
||||
public bool EnableMetrics { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the public mapped port.
|
||||
/// </summary>
|
||||
/// <value>The public mapped port.</value>
|
||||
public int PublicPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the public HTTPS port.
|
||||
/// </summary>
|
||||
/// <value>The public HTTPS port.</value>
|
||||
public int PublicHttpsPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP server port number.
|
||||
/// </summary>
|
||||
/// <value>The HTTP server port number.</value>
|
||||
public int HttpServerPortNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTPS server port number.
|
||||
/// </summary>
|
||||
/// <value>The HTTPS server port number.</value>
|
||||
public int HttpsPortNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use HTTPS.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// In order for HTTPS to be used, in addition to setting this to true, valid values must also be
|
||||
/// provided for <see cref="CertificatePath"/> and <see cref="CertificatePassword"/>.
|
||||
/// </remarks>
|
||||
public bool EnableHttps { get; set; }
|
||||
|
||||
public bool EnableNormalizedItemByNameIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the filesystem path of an X.509 certificate to use for SSL.
|
||||
/// </summary>
|
||||
public string CertificatePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password required to access the X.509 certificate data in the file specified by <see cref="CertificatePath"/>.
|
||||
/// </summary>
|
||||
public string CertificatePassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is port authorized.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value>
|
||||
public bool IsPortAuthorized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets if quick connect is available for use on this server.
|
||||
/// </summary>
|
||||
public bool QuickConnectAvailable { get; set; }
|
||||
|
||||
public bool EnableRemoteAccess { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [enable case sensitive item ids].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable case sensitive item ids]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableCaseSensitiveItemIds { get; set; }
|
||||
|
||||
public bool DisableLiveTvChannelUserDataName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata path.
|
||||
/// </summary>
|
||||
/// <value>The metadata path.</value>
|
||||
public string MetadataPath { get; set; }
|
||||
|
||||
public string MetadataNetworkPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the preferred metadata language.
|
||||
/// </summary>
|
||||
/// <value>The preferred metadata language.</value>
|
||||
public string PreferredMetadataLanguage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata country code.
|
||||
/// </summary>
|
||||
/// <value>The metadata country code.</value>
|
||||
public string MetadataCountryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Characters to be replaced with a ' ' in strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort replace characters.</value>
|
||||
public string[] SortReplaceCharacters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Characters to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove characters.</value>
|
||||
public string[] SortRemoveCharacters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Words to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove words.</value>
|
||||
public string[] SortRemoveWords { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
|
||||
/// </summary>
|
||||
/// <value>The min resume PCT.</value>
|
||||
public int MinResumePct { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
|
||||
/// </summary>
|
||||
/// <value>The max resume PCT.</value>
|
||||
public int MaxResumePct { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..
|
||||
/// </summary>
|
||||
/// <value>The min resume duration seconds.</value>
|
||||
public int MinResumeDurationSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The delay in seconds that we will wait after a file system change to try and discover what has been added/removed
|
||||
/// Some delay is necessary with some items because their creation is not atomic. It involves the creation of several
|
||||
/// different directories and files.
|
||||
/// </summary>
|
||||
/// <value>The file watcher delay.</value>
|
||||
public int LibraryMonitorDelay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [enable dashboard response caching].
|
||||
/// Allows potential contributors without visual studio to modify production dashboard code and test changes.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable dashboard response caching]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableDashboardResponseCaching { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image saving convention.
|
||||
/// </summary>
|
||||
/// <value>The image saving convention.</value>
|
||||
public ImageSavingConvention ImageSavingConvention { get; set; }
|
||||
|
||||
public MetadataOptions[] MetadataOptions { get; set; }
|
||||
|
||||
public bool SkipDeserializationForBasicTypes { get; set; }
|
||||
|
||||
public string ServerName { get; set; }
|
||||
|
||||
public string BaseUrl
|
||||
{
|
||||
get => _baseUrl;
|
||||
set
|
||||
{
|
||||
// Normalize the start of the string
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
// If baseUrl is empty, set an empty prefix string
|
||||
_baseUrl = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
if (value[0] != '/')
|
||||
{
|
||||
// If baseUrl was not configured with a leading slash, append one for consistency
|
||||
value = "/" + value;
|
||||
}
|
||||
|
||||
// Normalize the end of the string
|
||||
if (value[value.Length - 1] == '/')
|
||||
{
|
||||
// If baseUrl was configured with a trailing slash, remove it for consistency
|
||||
value = value.Remove(value.Length - 1);
|
||||
}
|
||||
|
||||
_baseUrl = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string UICulture { get; set; }
|
||||
|
||||
public bool SaveMetadataHidden { get; set; }
|
||||
|
||||
public NameValuePair[] ContentTypes { get; set; }
|
||||
|
||||
public int RemoteClientBitrateLimit { get; set; }
|
||||
|
||||
public bool EnableFolderView { get; set; }
|
||||
|
||||
public bool EnableGroupingIntoCollections { get; set; }
|
||||
|
||||
public bool DisplaySpecialsWithinSeasons { get; set; }
|
||||
|
||||
public string[] LocalNetworkSubnets { get; set; }
|
||||
|
||||
public string[] LocalNetworkAddresses { get; set; }
|
||||
|
||||
public string[] CodecsUsed { get; set; }
|
||||
|
||||
public List<RepositoryInfo> PluginRepositories { get; set; }
|
||||
|
||||
public bool IgnoreVirtualInterfaces { get; set; }
|
||||
|
||||
public bool EnableExternalContentInSuggestions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server should force connections over HTTPS.
|
||||
/// </summary>
|
||||
public bool RequireHttps { get; set; }
|
||||
|
||||
public bool EnableNewOmdbSupport { get; set; }
|
||||
|
||||
public string[] RemoteIPFilter { get; set; }
|
||||
|
||||
public bool IsRemoteIPFilterBlacklist { get; set; }
|
||||
|
||||
public int ImageExtractionTimeoutMs { get; set; }
|
||||
|
||||
public PathSubstitution[] PathSubstitutions { get; set; }
|
||||
|
||||
public bool EnableSimpleArtistDetection { get; set; }
|
||||
|
||||
public string[] UninstalledPlugins { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether slow server responses should be logged as a warning.
|
||||
/// </summary>
|
||||
public bool EnableSlowResponseWarning { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the threshold for the slow response time warning in ms.
|
||||
/// </summary>
|
||||
public long SlowResponseThresholdMs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cors hosts.
|
||||
/// </summary>
|
||||
public string[] CorsHosts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the known proxies.
|
||||
/// </summary>
|
||||
public string[] KnownProxies { get; set; }
|
||||
private string _baseUrl = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
||||
/// </summary>
|
||||
public ServerConfiguration()
|
||||
{
|
||||
UninstalledPlugins = Array.Empty<string>();
|
||||
RemoteIPFilter = Array.Empty<string>();
|
||||
LocalNetworkSubnets = Array.Empty<string>();
|
||||
LocalNetworkAddresses = Array.Empty<string>();
|
||||
CodecsUsed = Array.Empty<string>();
|
||||
PathSubstitutions = Array.Empty<PathSubstitution>();
|
||||
IgnoreVirtualInterfaces = false;
|
||||
EnableSimpleArtistDetection = false;
|
||||
SkipDeserializationForBasicTypes = true;
|
||||
|
||||
PluginRepositories = new List<RepositoryInfo>();
|
||||
|
||||
DisplaySpecialsWithinSeasons = true;
|
||||
EnableExternalContentInSuggestions = true;
|
||||
|
||||
ImageSavingConvention = ImageSavingConvention.Compatible;
|
||||
PublicPort = DefaultHttpPort;
|
||||
PublicHttpsPort = DefaultHttpsPort;
|
||||
HttpServerPortNumber = DefaultHttpPort;
|
||||
HttpsPortNumber = DefaultHttpsPort;
|
||||
EnableMetrics = false;
|
||||
EnableHttps = false;
|
||||
EnableDashboardResponseCaching = true;
|
||||
EnableCaseSensitiveItemIds = true;
|
||||
EnableNormalizedItemByNameIds = true;
|
||||
DisableLiveTvChannelUserDataName = true;
|
||||
EnableNewOmdbSupport = true;
|
||||
|
||||
EnableRemoteAccess = true;
|
||||
QuickConnectAvailable = false;
|
||||
|
||||
EnableUPnP = false;
|
||||
MinResumePct = 5;
|
||||
MaxResumePct = 90;
|
||||
|
||||
// 5 minutes
|
||||
MinResumeDurationSeconds = 300;
|
||||
|
||||
LibraryMonitorDelay = 60;
|
||||
|
||||
ContentTypes = Array.Empty<NameValuePair>();
|
||||
|
||||
PreferredMetadataLanguage = "en";
|
||||
MetadataCountryCode = "US";
|
||||
|
||||
SortReplaceCharacters = new[] { ".", "+", "%" };
|
||||
SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" };
|
||||
SortRemoveWords = new[] { "the", "a", "an" };
|
||||
|
||||
BaseUrl = string.Empty;
|
||||
UICulture = "en-US";
|
||||
|
||||
MetadataOptions = new[]
|
||||
{
|
||||
new MetadataOptions()
|
||||
@@ -376,18 +78,366 @@ namespace MediaBrowser.Model.Configuration
|
||||
DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }
|
||||
}
|
||||
};
|
||||
|
||||
EnableSlowResponseWarning = true;
|
||||
SlowResponseThresholdMs = 500;
|
||||
CorsHosts = new[] { "*" };
|
||||
KnownProxies = Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
||||
public class PathSubstitution
|
||||
{
|
||||
public string From { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to enable automatic port forwarding.
|
||||
/// </summary>
|
||||
public bool EnableUPnP { get; set; } = false;
|
||||
|
||||
public string To { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to enable prometheus metrics exporting.
|
||||
/// </summary>
|
||||
public bool EnableMetrics { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the public mapped port.
|
||||
/// </summary>
|
||||
/// <value>The public mapped port.</value>
|
||||
public int PublicPort { get; set; } = DefaultHttpPort;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the http port should be mapped as part of UPnP automatic port forwarding.
|
||||
/// </summary>
|
||||
public bool UPnPCreateHttpPortMap { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets client udp port range.
|
||||
/// </summary>
|
||||
public string UDPPortRange { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether IPV6 capability is enabled.
|
||||
/// </summary>
|
||||
public bool EnableIPV6 { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether IPV4 capability is enabled.
|
||||
/// </summary>
|
||||
public bool EnableIPV4 { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether detailed ssdp logs are sent to the console/log.
|
||||
/// "Emby.Dlna": "Debug" must be set in logging.default.json for this property to work.
|
||||
/// </summary>
|
||||
public bool EnableSSDPTracing { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether an IP address is to be used to filter the detailed ssdp logs that are being sent to the console/log.
|
||||
/// If the setting "Emby.Dlna": "Debug" msut be set in logging.default.json for this property to work.
|
||||
/// </summary>
|
||||
public string SSDPTracingFilter { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of times SSDP UDP messages are sent.
|
||||
/// </summary>
|
||||
public int UDPSendCount { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the delay between each groups of SSDP messages (in ms).
|
||||
/// </summary>
|
||||
public int UDPSendDelay { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether address names that match <see cref="VirtualInterfaceNames"/> should be Ignore for the purposes of binding.
|
||||
/// </summary>
|
||||
public bool IgnoreVirtualInterfaces { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. <seealso cref="IgnoreVirtualInterfaces"/>.
|
||||
/// </summary>
|
||||
public string VirtualInterfaceNames { get; set; } = "vEthernet*";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time (in seconds) between the pings of SSDP gateway monitor.
|
||||
/// </summary>
|
||||
public int GatewayMonitorPeriod { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether multi-socket binding is available.
|
||||
/// </summary>
|
||||
public bool EnableMultiSocketBinding { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether all IPv6 interfaces should be treated as on the internal network.
|
||||
/// Depending on the address range implemented ULA ranges might not be used.
|
||||
/// </summary>
|
||||
public bool TrustAllIP6Interfaces { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ports that HDHomerun uses.
|
||||
/// </summary>
|
||||
public string HDHomerunPortRange { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets PublishedServerUri to advertise for specific subnets.
|
||||
/// </summary>
|
||||
public string[] PublishedServerUriBySubnet { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether Autodiscovery tracing is enabled.
|
||||
/// </summary>
|
||||
public bool AutoDiscoveryTracing { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether Autodiscovery is enabled.
|
||||
/// </summary>
|
||||
public bool AutoDiscovery { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the public HTTPS port.
|
||||
/// </summary>
|
||||
/// <value>The public HTTPS port.</value>
|
||||
public int PublicHttpsPort { get; set; } = DefaultHttpsPort;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP server port number.
|
||||
/// </summary>
|
||||
/// <value>The HTTP server port number.</value>
|
||||
public int HttpServerPortNumber { get; set; } = DefaultHttpPort;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTPS server port number.
|
||||
/// </summary>
|
||||
/// <value>The HTTPS server port number.</value>
|
||||
public int HttpsPortNumber { get; set; } = DefaultHttpsPort;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use HTTPS.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// In order for HTTPS to be used, in addition to setting this to true, valid values must also be
|
||||
/// provided for <see cref="CertificatePath"/> and <see cref="CertificatePassword"/>.
|
||||
/// </remarks>
|
||||
public bool EnableHttps { get; set; } = false;
|
||||
|
||||
public bool EnableNormalizedItemByNameIds { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the filesystem path of an X.509 certificate to use for SSL.
|
||||
/// </summary>
|
||||
public string CertificatePath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password required to access the X.509 certificate data in the file specified by <see cref="CertificatePath"/>.
|
||||
/// </summary>
|
||||
public string CertificatePassword { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is port authorized.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value>
|
||||
public bool IsPortAuthorized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether quick connect is available for use on this server.
|
||||
/// </summary>
|
||||
public bool QuickConnectAvailable { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether access outside of the LAN is permitted.
|
||||
/// </summary>
|
||||
public bool EnableRemoteAccess { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [enable case sensitive item ids].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable case sensitive item ids]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableCaseSensitiveItemIds { get; set; } = true;
|
||||
|
||||
public bool DisableLiveTvChannelUserDataName { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata path.
|
||||
/// </summary>
|
||||
/// <value>The metadata path.</value>
|
||||
public string MetadataPath { get; set; } = string.Empty;
|
||||
|
||||
public string MetadataNetworkPath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the preferred metadata language.
|
||||
/// </summary>
|
||||
/// <value>The preferred metadata language.</value>
|
||||
public string PreferredMetadataLanguage { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata country code.
|
||||
/// </summary>
|
||||
/// <value>The metadata country code.</value>
|
||||
public string MetadataCountryCode { get; set; } = "US";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets characters to be replaced with a ' ' in strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort replace characters.</value>
|
||||
public string[] SortReplaceCharacters { get; set; } = new[] { ".", "+", "%" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets characters to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove characters.</value>
|
||||
public string[] SortRemoveCharacters { get; set; } = new[] { ",", "&", "-", "{", "}", "'" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets words to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove words.</value>
|
||||
public string[] SortRemoveWords { get; set; } = new[] { "the", "a", "an" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
|
||||
/// </summary>
|
||||
/// <value>The min resume PCT.</value>
|
||||
public int MinResumePct { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
|
||||
/// </summary>
|
||||
/// <value>The max resume PCT.</value>
|
||||
public int MaxResumePct { get; set; } = 90;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..
|
||||
/// </summary>
|
||||
/// <value>The min resume duration seconds.</value>
|
||||
public int MinResumeDurationSeconds { get; set; } = 300;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed
|
||||
/// Some delay is necessary with some items because their creation is not atomic. It involves the creation of several
|
||||
/// different directories and files.
|
||||
/// </summary>
|
||||
/// <value>The file watcher delay.</value>
|
||||
public int LibraryMonitorDelay { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [enable dashboard response caching].
|
||||
/// Allows potential contributors without visual studio to modify production dashboard code and test changes.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable dashboard response caching]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableDashboardResponseCaching { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image saving convention.
|
||||
/// </summary>
|
||||
/// <value>The image saving convention.</value>
|
||||
public ImageSavingConvention ImageSavingConvention { get; set; }
|
||||
|
||||
public MetadataOptions[] MetadataOptions { get; set; }
|
||||
|
||||
public bool SkipDeserializationForBasicTypes { get; set; } = true;
|
||||
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
|
||||
public string BaseUrl
|
||||
{
|
||||
get => _baseUrl;
|
||||
set
|
||||
{
|
||||
// Normalize the start of the string
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
// If baseUrl is empty, set an empty prefix string
|
||||
_baseUrl = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
if (value[0] != '/')
|
||||
{
|
||||
// If baseUrl was not configured with a leading slash, append one for consistency
|
||||
value = "/" + value;
|
||||
}
|
||||
|
||||
// Normalize the end of the string
|
||||
if (value[value.Length - 1] == '/')
|
||||
{
|
||||
// If baseUrl was configured with a trailing slash, remove it for consistency
|
||||
value = value.Remove(value.Length - 1);
|
||||
}
|
||||
|
||||
_baseUrl = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string UICulture { get; set; } = "en-US";
|
||||
|
||||
public bool SaveMetadataHidden { get; set; } = false;
|
||||
|
||||
public NameValuePair[] ContentTypes { get; set; } = Array.Empty<NameValuePair>();
|
||||
|
||||
public int RemoteClientBitrateLimit { get; set; } = 0;
|
||||
|
||||
public bool EnableFolderView { get; set; } = false;
|
||||
|
||||
public bool EnableGroupingIntoCollections { get; set; } = false;
|
||||
|
||||
public bool DisplaySpecialsWithinSeasons { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the subnets that are deemed to make up the LAN.
|
||||
/// </summary>
|
||||
public string[] LocalNetworkSubnets { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used.
|
||||
/// </summary>
|
||||
public string[] LocalNetworkAddresses { get; set; } = Array.Empty<string>();
|
||||
|
||||
public string[] CodecsUsed { get; set; } = Array.Empty<string>();
|
||||
|
||||
public List<RepositoryInfo> PluginRepositories { get; set; } = new List<RepositoryInfo>();
|
||||
|
||||
public bool EnableExternalContentInSuggestions { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server should force connections over HTTPS.
|
||||
/// </summary>
|
||||
public bool RequireHttps { get; set; } = false;
|
||||
|
||||
public bool EnableNewOmdbSupport { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the filter for remote IP connectivity. Used in conjuntion with <seealso cref="IsRemoteIPFilterBlacklist"/>.
|
||||
/// </summary>
|
||||
public string[] RemoteIPFilter { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether <seealso cref="RemoteIPFilter"/> contains a blacklist or a whitelist. Default is a whitelist.
|
||||
/// </summary>
|
||||
public bool IsRemoteIPFilterBlacklist { get; set; } = false;
|
||||
|
||||
public int ImageExtractionTimeoutMs { get; set; } = 0;
|
||||
|
||||
public PathSubstitution[] PathSubstitutions { get; set; } = Array.Empty<PathSubstitution>();
|
||||
|
||||
public bool EnableSimpleArtistDetection { get; set; } = false;
|
||||
|
||||
public string[] UninstalledPlugins { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether slow server responses should be logged as a warning.
|
||||
/// </summary>
|
||||
public bool EnableSlowResponseWarning { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the threshold for the slow response time warning in ms.
|
||||
/// </summary>
|
||||
public long SlowResponseThresholdMs { get; set; } = 500;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cors hosts.
|
||||
/// </summary>
|
||||
public string[] CorsHosts { get; set; } = new[] { "*" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the known proxies.
|
||||
/// </summary>
|
||||
public string[] KnownProxies { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days we should retain activity logs.
|
||||
/// </summary>
|
||||
public int? ActivityLogRetentionDays { get; set; } = 30;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<System.Int32>.</returns>
|
||||
public long? GetMaxBitrate(bool isAudio)
|
||||
public int? GetMaxBitrate(bool isAudio)
|
||||
{
|
||||
if (MaxBitrate.HasValue)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -11,59 +11,54 @@ namespace MediaBrowser.Model.Dlna
|
||||
/// Gets or sets the name of the friendly.
|
||||
/// </summary>
|
||||
/// <value>The name of the friendly.</value>
|
||||
public string FriendlyName { get; set; }
|
||||
public string FriendlyName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model number.
|
||||
/// </summary>
|
||||
/// <value>The model number.</value>
|
||||
public string ModelNumber { get; set; }
|
||||
public string ModelNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the serial number.
|
||||
/// </summary>
|
||||
/// <value>The serial number.</value>
|
||||
public string SerialNumber { get; set; }
|
||||
public string SerialNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the model.
|
||||
/// </summary>
|
||||
/// <value>The name of the model.</value>
|
||||
public string ModelName { get; set; }
|
||||
public string ModelName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model description.
|
||||
/// </summary>
|
||||
/// <value>The model description.</value>
|
||||
public string ModelDescription { get; set; }
|
||||
public string ModelDescription { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the model URL.
|
||||
/// </summary>
|
||||
/// <value>The model URL.</value>
|
||||
public string ModelUrl { get; set; }
|
||||
public string ModelUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the manufacturer.
|
||||
/// </summary>
|
||||
/// <value>The manufacturer.</value>
|
||||
public string Manufacturer { get; set; }
|
||||
public string Manufacturer { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the manufacturer URL.
|
||||
/// </summary>
|
||||
/// <value>The manufacturer URL.</value>
|
||||
public string ManufacturerUrl { get; set; }
|
||||
public string ManufacturerUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the headers.
|
||||
/// </summary>
|
||||
/// <value>The headers.</value>
|
||||
public HttpHeaderInfo[] Headers { get; set; }
|
||||
|
||||
public DeviceIdentification()
|
||||
{
|
||||
Headers = Array.Empty<HttpHeaderInfo>();
|
||||
}
|
||||
public HttpHeaderInfo[] Headers { get; set; } = Array.Empty<HttpHeaderInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
#pragma warning disable CA1819 // Properties should not return arrays
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
@@ -8,107 +7,15 @@ using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="DeviceProfile" />.
|
||||
/// </summary>
|
||||
[XmlRoot("Profile")]
|
||||
public class DeviceProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// Initializes a new instance of the <see cref="DeviceProfile"/> class.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identification.
|
||||
/// </summary>
|
||||
/// <value>The identification.</value>
|
||||
public DeviceIdentification Identification { get; set; }
|
||||
|
||||
public string FriendlyName { get; set; }
|
||||
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
public string ManufacturerUrl { get; set; }
|
||||
|
||||
public string ModelName { get; set; }
|
||||
|
||||
public string ModelDescription { get; set; }
|
||||
|
||||
public string ModelNumber { get; set; }
|
||||
|
||||
public string ModelUrl { get; set; }
|
||||
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
public bool EnableAlbumArtInDidl { get; set; }
|
||||
|
||||
public bool EnableSingleAlbumArtLimit { get; set; }
|
||||
|
||||
public bool EnableSingleSubtitleLimit { get; set; }
|
||||
|
||||
public string SupportedMediaTypes { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
|
||||
public string AlbumArtPn { get; set; }
|
||||
|
||||
public int MaxAlbumArtWidth { get; set; }
|
||||
|
||||
public int MaxAlbumArtHeight { get; set; }
|
||||
|
||||
public int? MaxIconWidth { get; set; }
|
||||
|
||||
public int? MaxIconHeight { get; set; }
|
||||
|
||||
public long? MaxStreamingBitrate { get; set; }
|
||||
|
||||
public long? MaxStaticBitrate { get; set; }
|
||||
|
||||
public int? MusicStreamingTranscodingBitrate { get; set; }
|
||||
|
||||
public int? MaxStaticMusicBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
|
||||
/// </summary>
|
||||
public string SonyAggregationFlags { get; set; }
|
||||
|
||||
public string ProtocolInfo { get; set; }
|
||||
|
||||
public int TimelineOffsetSeconds { get; set; }
|
||||
|
||||
public bool RequiresPlainVideoItems { get; set; }
|
||||
|
||||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
||||
|
||||
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
||||
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direct play profiles.
|
||||
/// </summary>
|
||||
/// <value>The direct play profiles.</value>
|
||||
public DirectPlayProfile[] DirectPlayProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the transcoding profiles.
|
||||
/// </summary>
|
||||
/// <value>The transcoding profiles.</value>
|
||||
public TranscodingProfile[] TranscodingProfiles { get; set; }
|
||||
|
||||
public ContainerProfile[] ContainerProfiles { get; set; }
|
||||
|
||||
public CodecProfile[] CodecProfiles { get; set; }
|
||||
|
||||
public ResponseProfile[] ResponseProfiles { get; set; }
|
||||
|
||||
public SubtitleProfile[] SubtitleProfiles { get; set; }
|
||||
|
||||
public DeviceProfile()
|
||||
{
|
||||
DirectPlayProfiles = Array.Empty<DirectPlayProfile>();
|
||||
@@ -126,11 +33,217 @@ namespace MediaBrowser.Model.Dlna
|
||||
MusicStreamingTranscodingBitrate = 128000;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Id.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Identification.
|
||||
/// </summary>
|
||||
public DeviceIdentification Identification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the FriendlyName.
|
||||
/// </summary>
|
||||
public string FriendlyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Manufacturer.
|
||||
/// </summary>
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ManufacturerUrl.
|
||||
/// </summary>
|
||||
public string ManufacturerUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelName.
|
||||
/// </summary>
|
||||
public string ModelName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelDescription.
|
||||
/// </summary>
|
||||
public string ModelDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelNumber.
|
||||
/// </summary>
|
||||
public string ModelNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ModelUrl.
|
||||
/// </summary>
|
||||
public string ModelUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SerialNumber.
|
||||
/// </summary>
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableAlbumArtInDidl.
|
||||
/// </summary>
|
||||
public bool EnableAlbumArtInDidl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableSingleAlbumArtLimit.
|
||||
/// </summary>
|
||||
public bool EnableSingleAlbumArtLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableSingleSubtitleLimit.
|
||||
/// </summary>
|
||||
public bool EnableSingleSubtitleLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SupportedMediaTypes.
|
||||
/// </summary>
|
||||
public string SupportedMediaTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UserId.
|
||||
/// </summary>
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AlbumArtPn.
|
||||
/// </summary>
|
||||
public string AlbumArtPn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxAlbumArtWidth.
|
||||
/// </summary>
|
||||
public int MaxAlbumArtWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxAlbumArtHeight.
|
||||
/// </summary>
|
||||
public int MaxAlbumArtHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxIconWidth.
|
||||
/// </summary>
|
||||
public int? MaxIconWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxIconHeight.
|
||||
/// </summary>
|
||||
public int? MaxIconHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxStreamingBitrate.
|
||||
/// </summary>
|
||||
public int? MaxStreamingBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxStaticBitrate.
|
||||
/// </summary>
|
||||
public int? MaxStaticBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MusicStreamingTranscodingBitrate.
|
||||
/// </summary>
|
||||
public int? MusicStreamingTranscodingBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MaxStaticMusicBitrate.
|
||||
/// </summary>
|
||||
public int? MaxStaticMusicBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
|
||||
/// </summary>
|
||||
public string SonyAggregationFlags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ProtocolInfo.
|
||||
/// </summary>
|
||||
public string ProtocolInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TimelineOffsetSeconds.
|
||||
/// </summary>
|
||||
public int TimelineOffsetSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether RequiresPlainVideoItems.
|
||||
/// </summary>
|
||||
public bool RequiresPlainVideoItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether RequiresPlainFolders.
|
||||
/// </summary>
|
||||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.
|
||||
/// </summary>
|
||||
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.
|
||||
/// </summary>
|
||||
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the XmlRootAttributes.
|
||||
/// </summary>
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direct play profiles.
|
||||
/// </summary>
|
||||
public DirectPlayProfile[] DirectPlayProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the transcoding profiles.
|
||||
/// </summary>
|
||||
public TranscodingProfile[] TranscodingProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ContainerProfiles.
|
||||
/// </summary>
|
||||
public ContainerProfile[] ContainerProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the CodecProfiles.
|
||||
/// </summary>
|
||||
public CodecProfile[] CodecProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ResponseProfiles.
|
||||
/// </summary>
|
||||
public ResponseProfile[] ResponseProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SubtitleProfiles.
|
||||
/// </summary>
|
||||
public SubtitleProfile[] SubtitleProfiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The GetSupportedMediaTypes.
|
||||
/// </summary>
|
||||
/// <returns>The .</returns>
|
||||
public string[] GetSupportedMediaTypes()
|
||||
{
|
||||
return ContainerProfile.SplitValue(SupportedMediaTypes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audio transcoding profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio Codec.</param>
|
||||
/// <returns>A <see cref="TranscodingProfile"/>.</returns>
|
||||
public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec)
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
@@ -158,6 +271,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the video transcoding profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio Codec.</param>
|
||||
/// <param name="videoCodec">The video Codec.</param>
|
||||
/// <returns>The <see cref="TranscodingProfile"/>.</returns>
|
||||
public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec)
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
@@ -190,6 +310,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audio media profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio codec.</param>
|
||||
/// <param name="audioChannels">The audio channels.</param>
|
||||
/// <param name="audioBitrate">The audio bitrate.</param>
|
||||
/// <param name="audioSampleRate">The audio sample rate.</param>
|
||||
/// <param name="audioBitDepth">The audio bit depth.</param>
|
||||
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
||||
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
|
||||
{
|
||||
foreach (var i in ResponseProfiles)
|
||||
@@ -231,6 +361,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model profile condition.
|
||||
/// </summary>
|
||||
/// <param name="c">The c<see cref="ProfileCondition"/>.</param>
|
||||
/// <returns>The <see cref="ProfileCondition"/>.</returns>
|
||||
private ProfileCondition GetModelProfileCondition(ProfileCondition c)
|
||||
{
|
||||
return new ProfileCondition
|
||||
@@ -242,6 +377,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image media profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="width">The width.</param>
|
||||
/// <param name="height">The height.</param>
|
||||
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
||||
public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
|
||||
{
|
||||
foreach (var i in ResponseProfiles)
|
||||
@@ -277,6 +419,29 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the video media profile.
|
||||
/// </summary>
|
||||
/// <param name="container">The container.</param>
|
||||
/// <param name="audioCodec">The audio codec.</param>
|
||||
/// <param name="videoCodec">The video codec.</param>
|
||||
/// <param name="width">The width.</param>
|
||||
/// <param name="height">The height.</param>
|
||||
/// <param name="bitDepth">The bit depth.</param>
|
||||
/// <param name="videoBitrate">The video bitrate.</param>
|
||||
/// <param name="videoProfile">The video profile.</param>
|
||||
/// <param name="videoLevel">The video level.</param>
|
||||
/// <param name="videoFramerate">The video framerate.</param>
|
||||
/// <param name="packetLength">The packet length.</param>
|
||||
/// <param name="timestamp">The timestamp<see cref="TransportStreamTimestamp"/>.</param>
|
||||
/// <param name="isAnamorphic">True if anamorphic.</param>
|
||||
/// <param name="isInterlaced">True if interlaced.</param>
|
||||
/// <param name="refFrames">The ref frames.</param>
|
||||
/// <param name="numVideoStreams">The number of video streams.</param>
|
||||
/// <param name="numAudioStreams">The number of audio streams.</param>
|
||||
/// <param name="videoCodecTag">The video Codec tag.</param>
|
||||
/// <param name="isAvc">True if Avc.</param>
|
||||
/// <returns>The <see cref="ResponseProfile"/>.</returns>
|
||||
public ResponseProfile GetVideoMediaProfile(
|
||||
string container,
|
||||
string audioCodec,
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
new ResolutionConfiguration(720, 950000),
|
||||
new ResolutionConfiguration(1280, 2500000),
|
||||
new ResolutionConfiguration(1920, 4000000),
|
||||
new ResolutionConfiguration(2560, 8000000),
|
||||
new ResolutionConfiguration(2560, 20000000),
|
||||
new ResolutionConfiguration(3840, 35000000)
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? maxWidth,
|
||||
int? maxHeight)
|
||||
{
|
||||
// If the bitrate isn't changing, then don't downlscale the resolution
|
||||
// If the bitrate isn't changing, then don't downscale the resolution
|
||||
if (inputBitrate.HasValue && outputBitrate >= inputBitrate.Value)
|
||||
{
|
||||
if (maxWidth.HasValue || maxHeight.HasValue)
|
||||
@@ -80,11 +80,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private static double GetVideoBitrateScaleFactor(string codec)
|
||||
{
|
||||
if (string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(codec, "vp9", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(codec, "vp9", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return .5;
|
||||
return .6;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -872,11 +872,34 @@ namespace MediaBrowser.Model.Dlna
|
||||
return playlistItem;
|
||||
}
|
||||
|
||||
private static int GetDefaultAudioBitrateIfUnknown(MediaStream audioStream)
|
||||
private static int GetDefaultAudioBitrate(string audioCodec, int? audioChannels)
|
||||
{
|
||||
if ((audioStream.Channels ?? 0) >= 6)
|
||||
if (!string.IsNullOrEmpty(audioCodec))
|
||||
{
|
||||
return 384000;
|
||||
// Default to a higher bitrate for stream copy
|
||||
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(audioCodec, "eac3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if ((audioChannels ?? 0) < 2)
|
||||
{
|
||||
return 128000;
|
||||
}
|
||||
|
||||
return (audioChannels ?? 0) >= 6 ? 640000 : 384000;
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "flac", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(audioCodec, "alac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if ((audioChannels ?? 0) < 2)
|
||||
{
|
||||
return 768000;
|
||||
}
|
||||
|
||||
return (audioChannels ?? 0) >= 6 ? 3584000 : 1536000;
|
||||
}
|
||||
}
|
||||
|
||||
return 192000;
|
||||
@@ -897,14 +920,27 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAudioChannels.HasValue && audioStream.Channels.HasValue && targetAudioChannels.Value < audioStream.Channels.Value)
|
||||
if (targetAudioChannels.HasValue
|
||||
&& audioStream.Channels.HasValue
|
||||
&& audioStream.Channels.Value > targetAudioChannels.Value)
|
||||
{
|
||||
// Reduce the bitrate if we're downmixing
|
||||
defaultBitrate = targetAudioChannels.Value < 2 ? 128000 : 192000;
|
||||
// Reduce the bitrate if we're downmixing.
|
||||
defaultBitrate = GetDefaultAudioBitrate(targetAudioCodec, targetAudioChannels);
|
||||
}
|
||||
else if (targetAudioChannels.HasValue
|
||||
&& audioStream.Channels.HasValue
|
||||
&& audioStream.Channels.Value <= targetAudioChannels.Value
|
||||
&& !string.IsNullOrEmpty(audioStream.Codec)
|
||||
&& targetAudioCodecs != null
|
||||
&& targetAudioCodecs.Length > 0
|
||||
&& !Array.Exists(targetAudioCodecs, elem => string.Equals(audioStream.Codec, elem, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// Shift the bitrate if we're transcoding to a different audio codec.
|
||||
defaultBitrate = GetDefaultAudioBitrate(targetAudioCodec, audioStream.Channels.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultBitrate = audioStream.BitRate ?? GetDefaultAudioBitrateIfUnknown(audioStream);
|
||||
defaultBitrate = audioStream.BitRate ?? GetDefaultAudioBitrate(targetAudioCodec, targetAudioChannels);
|
||||
}
|
||||
|
||||
// Seeing webm encoding failures when source has 1 audio channel and 22k bitrate.
|
||||
@@ -938,8 +974,28 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return 448000;
|
||||
}
|
||||
else if (totalBitrate <= 4000000)
|
||||
{
|
||||
return 640000;
|
||||
}
|
||||
else if (totalBitrate <= 5000000)
|
||||
{
|
||||
return 768000;
|
||||
}
|
||||
else if (totalBitrate <= 10000000)
|
||||
{
|
||||
return 1536000;
|
||||
}
|
||||
else if (totalBitrate <= 15000000)
|
||||
{
|
||||
return 2304000;
|
||||
}
|
||||
else if (totalBitrate <= 20000000)
|
||||
{
|
||||
return 3584000;
|
||||
}
|
||||
|
||||
return 640000;
|
||||
return 7168000;
|
||||
}
|
||||
|
||||
private (PlayMethod?, List<TranscodeReason>) GetVideoDirectPlayProfile(
|
||||
@@ -1438,6 +1494,32 @@ namespace MediaBrowser.Model.Dlna
|
||||
break;
|
||||
}
|
||||
|
||||
case ProfileConditionValue.AudioSampleRate:
|
||||
{
|
||||
if (!enableNonQualifiedConditions)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var num))
|
||||
{
|
||||
if (condition.Condition == ProfileConditionType.Equals)
|
||||
{
|
||||
item.AudioSampleRate = num;
|
||||
}
|
||||
else if (condition.Condition == ProfileConditionType.LessThanEqual)
|
||||
{
|
||||
item.AudioSampleRate = Math.Min(num, item.AudioSampleRate ?? num);
|
||||
}
|
||||
else if (condition.Condition == ProfileConditionType.GreaterThanEqual)
|
||||
{
|
||||
item.AudioSampleRate = Math.Max(num, item.AudioSampleRate ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ProfileConditionValue.AudioChannels:
|
||||
{
|
||||
if (string.IsNullOrEmpty(qualifier))
|
||||
@@ -1647,7 +1729,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)
|
||||
{
|
||||
|
||||
@@ -110,6 +110,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public int? AudioBitrate { get; set; }
|
||||
|
||||
public int? AudioSampleRate { get; set; }
|
||||
|
||||
public int? VideoBitrate { get; set; }
|
||||
|
||||
public int? MaxWidth { get; set; }
|
||||
@@ -183,8 +185,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
continue;
|
||||
}
|
||||
|
||||
// Be careful, IsDirectStream==true by default (Static != false or not in query).
|
||||
// See initialization of StreamingRequestDto in AudioController.GetAudioStream() method : Static = @static ?? true.
|
||||
if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(pair.Value, "false", StringComparison.OrdinalIgnoreCase))
|
||||
string.Equals(pair.Value, "true", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -250,6 +254,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
list.Add(new NameValuePair("SubtitleStreamIndex", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleStreamIndex.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("VideoBitrate", item.VideoBitrate.HasValue ? item.VideoBitrate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("AudioBitrate", item.AudioBitrate.HasValue ? item.AudioBitrate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("AudioSampleRate", item.AudioSampleRate.HasValue ? item.AudioSampleRate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
|
||||
list.Add(new NameValuePair("MaxFramerate", item.MaxFramerate.HasValue ? item.MaxFramerate.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
list.Add(new NameValuePair("MaxWidth", item.MaxWidth.HasValue ? item.MaxWidth.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
|
||||
@@ -521,7 +526,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
get
|
||||
{
|
||||
var stream = TargetAudioStream;
|
||||
return stream == null ? null : stream.SampleRate;
|
||||
return AudioSampleRate.HasValue && !IsDirectStream
|
||||
? AudioSampleRate
|
||||
: stream == null ? null : stream.SampleRate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -787,7 +794,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public int? GetTargetAudioChannels(string codec)
|
||||
{
|
||||
var defaultValue = GlobalMaxAudioChannels;
|
||||
var defaultValue = GlobalMaxAudioChannels ?? TranscodingMaxAudioChannels;
|
||||
|
||||
var value = GetOption(codec, "audiochannels");
|
||||
if (string.IsNullOrEmpty(value))
|
||||
|
||||
@@ -5,11 +5,20 @@ using System.Xml.Serialization;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="XmlAttribute" />.
|
||||
/// </summary>
|
||||
public class XmlAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the attribute.
|
||||
/// </summary>
|
||||
[XmlAttribute("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the attribute.
|
||||
/// </summary>
|
||||
[XmlAttribute("value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.Playlists
|
||||
{
|
||||
@@ -9,15 +10,10 @@ namespace MediaBrowser.Model.Playlists
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public Guid[] ItemIdList { get; set; }
|
||||
public IReadOnlyList<Guid> ItemIdList { get; set; } = Array.Empty<Guid>();
|
||||
|
||||
public string MediaType { get; set; }
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public PlaylistCreationRequest()
|
||||
{
|
||||
ItemIdList = Array.Empty<Guid>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
|
||||
namespace MediaBrowser.Model.Session
|
||||
{
|
||||
public class ClientCapabilities
|
||||
{
|
||||
public string[] PlayableMediaTypes { get; set; }
|
||||
public IReadOnlyList<string> PlayableMediaTypes { get; set; }
|
||||
|
||||
public GeneralCommandType[] SupportedCommands { get; set; }
|
||||
public IReadOnlyList<GeneralCommandType> SupportedCommands { get; set; }
|
||||
|
||||
public bool SupportsMediaControl { get; set; }
|
||||
|
||||
|
||||
34
MediaBrowser.Model/Subtitles/FontFile.cs
Normal file
34
MediaBrowser.Model/Subtitles/FontFile.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -50,17 +50,7 @@ namespace MediaBrowser.Model.Updates
|
||||
/// Gets or sets the versions.
|
||||
/// </summary>
|
||||
/// <value>The versions.</value>
|
||||
public IReadOnlyList<VersionInfo> versions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the repository name.
|
||||
/// </summary>
|
||||
public string repositoryName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the repository url.
|
||||
/// </summary>
|
||||
public string repositoryUrl { get; set; }
|
||||
public IList<VersionInfo> versions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PackageInfo"/> class.
|
||||
|
||||
@@ -16,5 +16,11 @@ namespace MediaBrowser.Model.Updates
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the repository is enabled.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if enabled.</value>
|
||||
public bool Enabled { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,11 +9,29 @@ namespace MediaBrowser.Model.Updates
|
||||
/// </summary>
|
||||
public class VersionInfo
|
||||
{
|
||||
private Version _version;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the version.
|
||||
/// </summary>
|
||||
/// <value>The version.</value>
|
||||
public string version { get; set; }
|
||||
public string version
|
||||
{
|
||||
get
|
||||
{
|
||||
return _version == null ? string.Empty : _version.ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_version = Version.Parse(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the version as a <see cref="Version"/>.
|
||||
/// </summary>
|
||||
public Version VersionNumber => _version;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the changelog for this version.
|
||||
@@ -44,5 +62,15 @@ namespace MediaBrowser.Model.Updates
|
||||
/// </summary>
|
||||
/// <value>The timestamp.</value>
|
||||
public string timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the repository name.
|
||||
/// </summary>
|
||||
public string repositoryName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the repository url.
|
||||
/// </summary>
|
||||
public string repositoryUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user