aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Configuration/EncodingOptions.cs3
-rw-r--r--MediaBrowser.Model/Configuration/PathSubstitution.cs20
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs410
-rw-r--r--MediaBrowser.Model/Dlna/DeviceIdentification.cs23
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfile.cs217
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionNormalizer.cs12
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs98
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs13
-rw-r--r--MediaBrowser.Model/Dlna/XmlAttribute.cs9
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs5
-rw-r--r--MediaBrowser.Model/Net/HttpException.cs42
-rw-r--r--MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs8
-rw-r--r--MediaBrowser.Model/Session/ClientCapabilities.cs5
-rw-r--r--MediaBrowser.Model/Updates/PackageInfo.cs12
-rw-r--r--MediaBrowser.Model/Updates/RepositoryInfo.cs6
-rw-r--r--MediaBrowser.Model/Updates/VersionInfo.cs30
16 files changed, 611 insertions, 302 deletions
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
index c34825667..100756c24 100644
--- a/MediaBrowser.Model/Configuration/EncodingOptions.cs
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -67,6 +67,8 @@ namespace MediaBrowser.Model.Configuration
public bool EnableHardwareEncoding { get; set; }
+ public bool AllowHevcEncoding { get; set; }
+
public bool EnableSubtitleExtraction { get; set; }
public string[] HardwareDecodingCodecs { get; set; }
@@ -99,6 +101,7 @@ namespace MediaBrowser.Model.Configuration
EnableDecodingColorDepth10Hevc = true;
EnableDecodingColorDepth10Vp9 = true;
EnableHardwareEncoding = true;
+ AllowHevcEncoding = true;
EnableSubtitleExtraction = true;
HardwareDecodingCodecs = new string[] { "h264", "vc1" };
}
diff --git a/MediaBrowser.Model/Configuration/PathSubstitution.cs b/MediaBrowser.Model/Configuration/PathSubstitution.cs
new file mode 100644
index 000000000..bffaa8594
--- /dev/null
+++ b/MediaBrowser.Model/Configuration/PathSubstitution.cs
@@ -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;
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index 23a5201f7..06985ebf4 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -1,5 +1,5 @@
-#nullable disable
#pragma warning disable CS1591
+#pragma warning disable CA1819
using System;
using System.Collections.Generic;
@@ -13,43 +13,194 @@ 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;
+
+ private string _baseUrl = string.Empty;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
+ /// </summary>
+ public ServerConfiguration()
+ {
+ MetadataOptions = new[]
+ {
+ new MetadataOptions()
+ {
+ ItemType = "Book"
+ },
+ new MetadataOptions()
+ {
+ ItemType = "Movie"
+ },
+ new MetadataOptions
+ {
+ ItemType = "MusicVideo",
+ DisabledMetadataFetchers = new[] { "The Open Movie Database" },
+ DisabledImageFetchers = new[] { "The Open Movie Database" }
+ },
+ new MetadataOptions
+ {
+ ItemType = "Series",
+ DisabledMetadataFetchers = new[] { "TheMovieDb" },
+ DisabledImageFetchers = new[] { "TheMovieDb" }
+ },
+ new MetadataOptions
+ {
+ ItemType = "MusicAlbum",
+ DisabledMetadataFetchers = new[] { "TheAudioDB" }
+ },
+ new MetadataOptions
+ {
+ ItemType = "MusicArtist",
+ DisabledMetadataFetchers = new[] { "TheAudioDB" }
+ },
+ new MetadataOptions
+ {
+ ItemType = "BoxSet"
+ },
+ new MetadataOptions
+ {
+ ItemType = "Season",
+ DisabledMetadataFetchers = new[] { "TheMovieDb" },
+ },
+ new MetadataOptions
+ {
+ ItemType = "Episode",
+ DisabledMetadataFetchers = new[] { "The Open Movie Database", "TheMovieDb" },
+ DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }
+ }
+ };
+ }
/// <summary>
/// Gets or sets a value indicating whether to enable automatic port forwarding.
/// </summary>
- public bool EnableUPnP { get; set; }
+ public bool EnableUPnP { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether to enable prometheus metrics exporting.
/// </summary>
- public bool EnableMetrics { get; set; }
+ 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; }
+ 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; }
+ 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; }
+ 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; }
+ public int HttpsPortNumber { get; set; } = DefaultHttpsPort;
/// <summary>
/// Gets or sets a value indicating whether to use HTTPS.
@@ -58,19 +209,19 @@ namespace MediaBrowser.Model.Configuration
/// 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 EnableHttps { get; set; } = false;
- public bool EnableNormalizedItemByNameIds { get; set; }
+ 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; }
+ 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; }
+ public string CertificatePassword { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether this instance is port authorized.
@@ -79,90 +230,93 @@ namespace MediaBrowser.Model.Configuration
public bool IsPortAuthorized { get; set; }
/// <summary>
- /// Gets or sets if quick connect is available for use on this server.
+ /// Gets or sets a value indicating whether quick connect is available for use on this server.
/// </summary>
- public bool QuickConnectAvailable { get; set; }
-
- public bool EnableRemoteAccess { get; set; }
+ 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; }
+ public bool EnableCaseSensitiveItemIds { get; set; } = true;
- public bool DisableLiveTvChannelUserDataName { get; set; }
+ public bool DisableLiveTvChannelUserDataName { get; set; } = true;
/// <summary>
/// Gets or sets the metadata path.
/// </summary>
/// <value>The metadata path.</value>
- public string MetadataPath { get; set; }
+ public string MetadataPath { get; set; } = string.Empty;
- public string MetadataNetworkPath { get; set; }
+ 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; }
+ 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; }
+ public string MetadataCountryCode { get; set; } = "US";
/// <summary>
- /// Characters to be replaced with a ' ' in strings to create a sort name.
+ /// 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; }
+ public string[] SortReplaceCharacters { get; set; } = new[] { ".", "+", "%" };
/// <summary>
- /// Characters to be removed from strings to create a sort name.
+ /// 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; }
+ public string[] SortRemoveCharacters { get; set; } = new[] { ",", "&", "-", "{", "}", "'" };
/// <summary>
- /// Words to be removed from strings to create a sort name.
+ /// 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; }
+ 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; }
+ 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; }
+ 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; }
+ public int MinResumeDurationSeconds { get; set; } = 300;
/// <summary>
- /// The delay in seconds that we will wait after a file system change to try and discover what has been added/removed
+ /// 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; }
+ 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; }
+ public bool EnableDashboardResponseCaching { get; set; } = true;
/// <summary>
/// Gets or sets the image saving convention.
@@ -172,9 +326,9 @@ namespace MediaBrowser.Model.Configuration
public MetadataOptions[] MetadataOptions { get; set; }
- public bool SkipDeserializationForBasicTypes { get; set; }
+ public bool SkipDeserializationForBasicTypes { get; set; } = true;
- public string ServerName { get; set; }
+ public string ServerName { get; set; } = string.Empty;
public string BaseUrl
{
@@ -206,194 +360,84 @@ namespace MediaBrowser.Model.Configuration
}
}
- public string UICulture { get; set; }
-
- public bool SaveMetadataHidden { get; set; }
+ public string UICulture { get; set; } = "en-US";
- public NameValuePair[] ContentTypes { get; set; }
+ public bool SaveMetadataHidden { get; set; } = false;
- public int RemoteClientBitrateLimit { get; set; }
+ public NameValuePair[] ContentTypes { get; set; } = Array.Empty<NameValuePair>();
- public bool EnableFolderView { get; set; }
+ public int RemoteClientBitrateLimit { get; set; } = 0;
- public bool EnableGroupingIntoCollections { get; set; }
+ public bool EnableFolderView { get; set; } = false;
- public bool DisplaySpecialsWithinSeasons { get; set; }
+ public bool EnableGroupingIntoCollections { get; set; } = false;
- public string[] LocalNetworkSubnets { get; set; }
+ public bool DisplaySpecialsWithinSeasons { get; set; } = true;
- public string[] LocalNetworkAddresses { get; set; }
+ /// <summary>
+ /// Gets or sets the subnets that are deemed to make up the LAN.
+ /// </summary>
+ public string[] LocalNetworkSubnets { get; set; } = Array.Empty<string>();
- public string[] CodecsUsed { get; set; }
+ /// <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 List<RepositoryInfo> PluginRepositories { get; set; }
+ public string[] CodecsUsed { get; set; } = Array.Empty<string>();
- public bool IgnoreVirtualInterfaces { get; set; }
+ public List<RepositoryInfo> PluginRepositories { get; set; } = new List<RepositoryInfo>();
- public bool EnableExternalContentInSuggestions { get; set; }
+ 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; }
+ public bool RequireHttps { get; set; } = false;
- public bool EnableNewOmdbSupport { get; set; }
+ public bool EnableNewOmdbSupport { get; set; } = true;
- public string[] RemoteIPFilter { get; set; }
+ /// <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>();
- public bool IsRemoteIPFilterBlacklist { get; set; }
+ /// <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; }
+ public int ImageExtractionTimeoutMs { get; set; } = 0;
- public PathSubstitution[] PathSubstitutions { get; set; }
+ public PathSubstitution[] PathSubstitutions { get; set; } = Array.Empty<PathSubstitution>();
- public bool EnableSimpleArtistDetection { get; set; }
+ public bool EnableSimpleArtistDetection { get; set; } = false;
- public string[] UninstalledPlugins { get; set; }
+ 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; }
+ 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; }
+ public long SlowResponseThresholdMs { get; set; } = 500;
/// <summary>
/// Gets or sets the cors hosts.
/// </summary>
- public string[] CorsHosts { get; set; }
+ public string[] CorsHosts { get; set; } = new[] { "*" };
/// <summary>
/// Gets or sets the known proxies.
/// </summary>
- public string[] KnownProxies { get; set; }
+ 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; }
-
- /// <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()
- {
- ItemType = "Book"
- },
- new MetadataOptions()
- {
- ItemType = "Movie"
- },
- new MetadataOptions
- {
- ItemType = "MusicVideo",
- DisabledMetadataFetchers = new[] { "The Open Movie Database" },
- DisabledImageFetchers = new[] { "The Open Movie Database" }
- },
- new MetadataOptions
- {
- ItemType = "Series",
- DisabledMetadataFetchers = new[] { "TheMovieDb" },
- DisabledImageFetchers = new[] { "TheMovieDb" }
- },
- new MetadataOptions
- {
- ItemType = "MusicAlbum",
- DisabledMetadataFetchers = new[] { "TheAudioDB" }
- },
- new MetadataOptions
- {
- ItemType = "MusicArtist",
- DisabledMetadataFetchers = new[] { "TheAudioDB" }
- },
- new MetadataOptions
- {
- ItemType = "BoxSet"
- },
- new MetadataOptions
- {
- ItemType = "Season",
- DisabledMetadataFetchers = new[] { "TheMovieDb" },
- },
- new MetadataOptions
- {
- ItemType = "Episode",
- DisabledMetadataFetchers = new[] { "The Open Movie Database", "TheMovieDb" },
- DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }
- }
- };
-
- EnableSlowResponseWarning = true;
- SlowResponseThresholdMs = 500;
- CorsHosts = new[] { "*" };
- KnownProxies = Array.Empty<string>();
- ActivityLogRetentionDays = 30;
- }
- }
-
- public class PathSubstitution
- {
- public string From { get; set; }
-
- public string To { get; set; }
+ public int? ActivityLogRetentionDays { get; set; } = 30;
}
}
diff --git a/MediaBrowser.Model/Dlna/DeviceIdentification.cs b/MediaBrowser.Model/Dlna/DeviceIdentification.cs
index 43407383a..c511801f4 100644
--- a/MediaBrowser.Model/Dlna/DeviceIdentification.cs
+++ b/MediaBrowser.Model/Dlna/DeviceIdentification.cs
@@ -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>();
}
}
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs
index e842efead..ff5186658 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs
@@ -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,129 +7,243 @@ 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>
+ public DeviceProfile()
+ {
+ DirectPlayProfiles = Array.Empty<DirectPlayProfile>();
+ TranscodingProfiles = Array.Empty<TranscodingProfile>();
+ ResponseProfiles = Array.Empty<ResponseProfile>();
+ CodecProfiles = Array.Empty<CodecProfile>();
+ ContainerProfiles = Array.Empty<ContainerProfile>();
+ SubtitleProfiles = Array.Empty<SubtitleProfile>();
+
+ XmlRootAttributes = Array.Empty<XmlAttribute>();
+
+ SupportedMediaTypes = "Audio,Photo,Video";
+ MaxStreamingBitrate = 8000000;
+ MaxStaticBitrate = 8000000;
+ MusicStreamingTranscodingBitrate = 128000;
+ }
+
+ /// <summary>
+ /// Gets or sets the Name.
/// </summary>
- /// <value>The name.</value>
public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the Id.
+ /// </summary>
[XmlIgnore]
public string Id { get; set; }
/// <summary>
- /// Gets or sets the identification.
+ /// Gets or sets the Identification.
/// </summary>
- /// <value>The identification.</value>
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>
- /// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
+ /// 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>
- /// <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; }
+ /// <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; }
- public DeviceProfile()
- {
- DirectPlayProfiles = Array.Empty<DirectPlayProfile>();
- TranscodingProfiles = Array.Empty<TranscodingProfile>();
- ResponseProfiles = Array.Empty<ResponseProfile>();
- CodecProfiles = Array.Empty<CodecProfile>();
- ContainerProfiles = Array.Empty<ContainerProfile>();
- SubtitleProfiles = Array.Empty<SubtitleProfile>();
-
- XmlRootAttributes = Array.Empty<XmlAttribute>();
-
- SupportedMediaTypes = "Audio,Photo,Video";
- MaxStreamingBitrate = 8000000;
- MaxStaticBitrate = 8000000;
- MusicStreamingTranscodingBitrate = 128000;
- }
-
+ /// <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,
diff --git a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
index a4305c810..65fccbdd4 100644
--- a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
@@ -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;
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 13234c381..59c981000 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -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))
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index 9399d21f1..55b12ae81 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -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))
diff --git a/MediaBrowser.Model/Dlna/XmlAttribute.cs b/MediaBrowser.Model/Dlna/XmlAttribute.cs
index 3a8939a79..03bb2e4b1 100644
--- a/MediaBrowser.Model/Dlna/XmlAttribute.cs
+++ b/MediaBrowser.Model/Dlna/XmlAttribute.cs
@@ -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; }
}
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index fa3c9aaa2..ca0b93c30 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -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);
diff --git a/MediaBrowser.Model/Net/HttpException.cs b/MediaBrowser.Model/Net/HttpException.cs
deleted file mode 100644
index 48ff5d51c..000000000
--- a/MediaBrowser.Model/Net/HttpException.cs
+++ /dev/null
@@ -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)
- {
- }
- }
-}
diff --git a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
index ef435b21e..e8ee49403 100644
--- a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
+++ b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
@@ -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>();
- }
}
}
diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.cs
index a85e6ff2a..5852f4e37 100644
--- a/MediaBrowser.Model/Session/ClientCapabilities.cs
+++ b/MediaBrowser.Model/Session/ClientCapabilities.cs
@@ -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; }
diff --git a/MediaBrowser.Model/Updates/PackageInfo.cs b/MediaBrowser.Model/Updates/PackageInfo.cs
index 98b151d55..5e9304363 100644
--- a/MediaBrowser.Model/Updates/PackageInfo.cs
+++ b/MediaBrowser.Model/Updates/PackageInfo.cs
@@ -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.
diff --git a/MediaBrowser.Model/Updates/RepositoryInfo.cs b/MediaBrowser.Model/Updates/RepositoryInfo.cs
index bd42e77f0..705d3b33c 100644
--- a/MediaBrowser.Model/Updates/RepositoryInfo.cs
+++ b/MediaBrowser.Model/Updates/RepositoryInfo.cs
@@ -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;
}
}
diff --git a/MediaBrowser.Model/Updates/VersionInfo.cs b/MediaBrowser.Model/Updates/VersionInfo.cs
index a4aa0e75f..844170999 100644
--- a/MediaBrowser.Model/Updates/VersionInfo.cs
+++ b/MediaBrowser.Model/Updates/VersionInfo.cs
@@ -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; }
}
}