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/ContainerProfile.cs2
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionNormalizer.cs12
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs72
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs2
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs10
-rw-r--r--MediaBrowser.Model/IO/IIsoManager.cs35
-rw-r--r--MediaBrowser.Model/IO/IIsoMount.cs22
-rw-r--r--MediaBrowser.Model/IO/IIsoMounter.cs35
-rw-r--r--MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs8
-rw-r--r--MediaBrowser.Model/Querying/NextUpQuery.cs2
-rw-r--r--MediaBrowser.Model/Search/SearchQuery.cs2
-rw-r--r--MediaBrowser.Model/Session/ClientCapabilities.cs5
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupInfoDto.cs58
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupInfoView.cs42
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupQueueMode.cs18
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupRepeatMode.cs23
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupShuffleMode.cs18
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupStateType.cs28
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupStateUpdate.cs31
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupUpdate.cs30
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupUpdateType.cs8
-rw-r--r--MediaBrowser.Model/SyncPlay/JoinGroupRequest.cs16
-rw-r--r--MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs74
-rw-r--r--MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs58
-rw-r--r--MediaBrowser.Model/SyncPlay/PlaybackRequest.cs34
-rw-r--r--MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs71
-rw-r--r--MediaBrowser.Model/SyncPlay/QueueItem.cs31
-rw-r--r--MediaBrowser.Model/SyncPlay/RequestType.cs33
-rw-r--r--MediaBrowser.Model/SyncPlay/SendCommand.cs45
-rw-r--r--MediaBrowser.Model/SyncPlay/SendCommandType.cs11
-rw-r--r--MediaBrowser.Model/SyncPlay/SyncPlayBroadcastType.cs28
-rw-r--r--MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs21
-rw-r--r--MediaBrowser.Model/Updates/PackageInfo.cs12
-rw-r--r--MediaBrowser.Model/Updates/RepositoryInfo.cs6
-rw-r--r--MediaBrowser.Model/Updates/VersionInfo.cs30
38 files changed, 923 insertions, 443 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..0dbd51bdc 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 QuickConnectAvailable { get; set; } = false;
- public bool EnableRemoteAccess { get; set; }
+ /// <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,94 @@ namespace MediaBrowser.Model.Configuration
}
}
- public string UICulture { get; set; }
+ public string UICulture { get; set; } = "en-US";
- public bool SaveMetadataHidden { get; set; }
+ public bool SaveMetadataHidden { get; set; } = false;
- public NameValuePair[] ContentTypes { get; set; }
+ public NameValuePair[] ContentTypes { get; set; } = Array.Empty<NameValuePair>();
- public int RemoteClientBitrateLimit { get; set; }
+ public int RemoteClientBitrateLimit { get; set; } = 0;
- public bool EnableFolderView { get; set; }
+ public bool EnableFolderView { get; set; } = false;
- public bool EnableGroupingIntoCollections { get; set; }
+ public bool EnableGroupingIntoCollections { get; set; } = false;
- public bool DisplaySpecialsWithinSeasons { get; set; }
+ public bool DisplaySpecialsWithinSeasons { get; set; } = true;
- public string[] LocalNetworkSubnets { get; set; }
-
- 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; }
+ public int? ActivityLogRetentionDays { get; set; } = 30;
/// <summary>
- /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
+ /// Gets or sets the how the library scan fans out.
/// </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";
+ public int LibraryScanFanoutConcurrency { get; set; }
- 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; }
+ /// <summary>
+ /// Gets or sets the how many metadata refreshes can run concurrently.
+ /// </summary>
+ public int LibraryMetadataRefreshConcurrency { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs
index 09afa64bb..56c89d854 100644
--- a/MediaBrowser.Model/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs
@@ -47,7 +47,7 @@ namespace MediaBrowser.Model.Dlna
public static bool ContainsContainer(string profileContainers, string inputContainer)
{
var isNegativeList = false;
- if (profileContainers != null && profileContainers.StartsWith("-", StringComparison.Ordinal))
+ if (profileContainers != null && profileContainers.StartsWith('-'))
{
isNegativeList = true;
profileContainers = profileContainers.Substring(1);
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 43d1f3b44..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(
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index 93ea82c1c..55b12ae81 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -794,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/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index fac754177..3f7aac9cd 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -152,7 +152,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the channel identifier.
/// </summary>
/// <value>The channel identifier.</value>
- public Guid ChannelId { get; set; }
+ public Guid? ChannelId { get; set; }
public string ChannelName { get; set; }
@@ -270,7 +270,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the parent id.
/// </summary>
/// <value>The parent id.</value>
- public Guid ParentId { get; set; }
+ public Guid? ParentId { get; set; }
/// <summary>
/// Gets or sets the type.
@@ -344,13 +344,13 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the series id.
/// </summary>
/// <value>The series id.</value>
- public Guid SeriesId { get; set; }
+ public Guid? SeriesId { get; set; }
/// <summary>
/// Gets or sets the season identifier.
/// </summary>
/// <value>The season identifier.</value>
- public Guid SeasonId { get; set; }
+ public Guid? SeasonId { get; set; }
/// <summary>
/// Gets or sets the special feature count.
@@ -428,7 +428,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the album id.
/// </summary>
/// <value>The album id.</value>
- public Guid AlbumId { get; set; }
+ public Guid? AlbumId { get; set; }
/// <summary>
/// Gets or sets the album image tag.
diff --git a/MediaBrowser.Model/IO/IIsoManager.cs b/MediaBrowser.Model/IO/IIsoManager.cs
deleted file mode 100644
index 299bb0a21..000000000
--- a/MediaBrowser.Model/IO/IIsoManager.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace MediaBrowser.Model.IO
-{
- public interface IIsoManager
- {
- /// <summary>
- /// Mounts the specified iso path.
- /// </summary>
- /// <param name="isoPath">The iso path.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>IsoMount.</returns>
- /// <exception cref="IOException">Unable to create mount.</exception>
- Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken);
-
- /// <summary>
- /// Determines whether this instance can mount the specified path.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
- bool CanMount(string path);
-
- /// <summary>
- /// Adds the parts.
- /// </summary>
- /// <param name="mounters">The mounters.</param>
- void AddParts(IEnumerable<IIsoMounter> mounters);
- }
-}
diff --git a/MediaBrowser.Model/IO/IIsoMount.cs b/MediaBrowser.Model/IO/IIsoMount.cs
deleted file mode 100644
index ea65d976a..000000000
--- a/MediaBrowser.Model/IO/IIsoMount.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.IO
-{
- /// <summary>
- /// Interface IIsoMount.
- /// </summary>
- public interface IIsoMount : IDisposable
- {
- /// <summary>
- /// Gets the iso path.
- /// </summary>
- /// <value>The iso path.</value>
- string IsoPath { get; }
-
- /// <summary>
- /// Gets the mounted path.
- /// </summary>
- /// <value>The mounted path.</value>
- string MountedPath { get; }
- }
-}
diff --git a/MediaBrowser.Model/IO/IIsoMounter.cs b/MediaBrowser.Model/IO/IIsoMounter.cs
deleted file mode 100644
index 0d257395a..000000000
--- a/MediaBrowser.Model/IO/IIsoMounter.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace MediaBrowser.Model.IO
-{
- public interface IIsoMounter
- {
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- string Name { get; }
-
- /// <summary>
- /// Mounts the specified iso path.
- /// </summary>
- /// <param name="isoPath">The iso path.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>IsoMount.</returns>
- /// <exception cref="ArgumentNullException">isoPath</exception>
- /// <exception cref="IOException">Unable to create mount.</exception>
- Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken);
-
- /// <summary>
- /// Determines whether this instance can mount the specified path.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
- bool CanMount(string path);
- }
-}
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/Querying/NextUpQuery.cs b/MediaBrowser.Model/Querying/NextUpQuery.cs
index ee13ffc16..4ad336d33 100644
--- a/MediaBrowser.Model/Querying/NextUpQuery.cs
+++ b/MediaBrowser.Model/Querying/NextUpQuery.cs
@@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Querying
/// Gets or sets the parent identifier.
/// </summary>
/// <value>The parent identifier.</value>
- public string ParentId { get; set; }
+ public Guid? ParentId { get; set; }
/// <summary>
/// Gets or sets the series id.
diff --git a/MediaBrowser.Model/Search/SearchQuery.cs b/MediaBrowser.Model/Search/SearchQuery.cs
index 01ad319a4..ce60062cd 100644
--- a/MediaBrowser.Model/Search/SearchQuery.cs
+++ b/MediaBrowser.Model/Search/SearchQuery.cs
@@ -47,7 +47,7 @@ namespace MediaBrowser.Model.Search
public string[] ExcludeItemTypes { get; set; }
- public string ParentId { get; set; }
+ public Guid? ParentId { get; set; }
public bool? IsMovie { get; set; }
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/SyncPlay/GroupInfoDto.cs b/MediaBrowser.Model/SyncPlay/GroupInfoDto.cs
new file mode 100644
index 000000000..8c0960b83
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/GroupInfoDto.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Class GroupInfoDto.
+ /// </summary>
+ public class GroupInfoDto
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="GroupInfoDto"/> class.
+ /// </summary>
+ /// <param name="groupId">The group identifier.</param>
+ /// <param name="groupName">The group name.</param>
+ /// <param name="state">The group state.</param>
+ /// <param name="participants">The participants.</param>
+ /// <param name="lastUpdatedAt">The date when this DTO has been created.</param>
+ public GroupInfoDto(Guid groupId, string groupName, GroupStateType state, IReadOnlyList<string> participants, DateTime lastUpdatedAt)
+ {
+ GroupId = groupId;
+ GroupName = groupName;
+ State = state;
+ Participants = participants;
+ LastUpdatedAt = lastUpdatedAt;
+ }
+
+ /// <summary>
+ /// Gets the group identifier.
+ /// </summary>
+ /// <value>The group identifier.</value>
+ public Guid GroupId { get; }
+
+ /// <summary>
+ /// Gets the group name.
+ /// </summary>
+ /// <value>The group name.</value>
+ public string GroupName { get; }
+
+ /// <summary>
+ /// Gets the group state.
+ /// </summary>
+ /// <value>The group state.</value>
+ public GroupStateType State { get; }
+
+ /// <summary>
+ /// Gets the participants.
+ /// </summary>
+ /// <value>The participants.</value>
+ public IReadOnlyList<string> Participants { get; }
+
+ /// <summary>
+ /// Gets the date when this DTO has been created.
+ /// </summary>
+ /// <value>The date when this DTO has been created.</value>
+ public DateTime LastUpdatedAt { get; }
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/GroupInfoView.cs b/MediaBrowser.Model/SyncPlay/GroupInfoView.cs
deleted file mode 100644
index f4c685998..000000000
--- a/MediaBrowser.Model/SyncPlay/GroupInfoView.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-#nullable disable
-
-using System.Collections.Generic;
-
-namespace MediaBrowser.Model.SyncPlay
-{
- /// <summary>
- /// Class GroupInfoView.
- /// </summary>
- public class GroupInfoView
- {
- /// <summary>
- /// Gets or sets the group identifier.
- /// </summary>
- /// <value>The group identifier.</value>
- public string GroupId { get; set; }
-
- /// <summary>
- /// Gets or sets the playing item id.
- /// </summary>
- /// <value>The playing item id.</value>
- public string PlayingItemId { get; set; }
-
- /// <summary>
- /// Gets or sets the playing item name.
- /// </summary>
- /// <value>The playing item name.</value>
- public string PlayingItemName { get; set; }
-
- /// <summary>
- /// Gets or sets the position ticks.
- /// </summary>
- /// <value>The position ticks.</value>
- public long PositionTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the participants.
- /// </summary>
- /// <value>The participants.</value>
- public IReadOnlyList<string> Participants { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/SyncPlay/GroupQueueMode.cs b/MediaBrowser.Model/SyncPlay/GroupQueueMode.cs
new file mode 100644
index 000000000..5c9c2627b
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/GroupQueueMode.cs
@@ -0,0 +1,18 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Enum GroupQueueMode.
+ /// </summary>
+ public enum GroupQueueMode
+ {
+ /// <summary>
+ /// Insert items at the end of the queue.
+ /// </summary>
+ Queue = 0,
+
+ /// <summary>
+ /// Insert items after the currently playing item.
+ /// </summary>
+ QueueNext = 1
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/GroupRepeatMode.cs b/MediaBrowser.Model/SyncPlay/GroupRepeatMode.cs
new file mode 100644
index 000000000..4895e57b7
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/GroupRepeatMode.cs
@@ -0,0 +1,23 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Enum GroupRepeatMode.
+ /// </summary>
+ public enum GroupRepeatMode
+ {
+ /// <summary>
+ /// Repeat one item only.
+ /// </summary>
+ RepeatOne = 0,
+
+ /// <summary>
+ /// Cycle the playlist.
+ /// </summary>
+ RepeatAll = 1,
+
+ /// <summary>
+ /// Do not repeat.
+ /// </summary>
+ RepeatNone = 2
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/GroupShuffleMode.cs b/MediaBrowser.Model/SyncPlay/GroupShuffleMode.cs
new file mode 100644
index 000000000..de860883c
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/GroupShuffleMode.cs
@@ -0,0 +1,18 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Enum GroupShuffleMode.
+ /// </summary>
+ public enum GroupShuffleMode
+ {
+ /// <summary>
+ /// Sorted playlist.
+ /// </summary>
+ Sorted = 0,
+
+ /// <summary>
+ /// Shuffled playlist.
+ /// </summary>
+ Shuffle = 1
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/GroupStateType.cs b/MediaBrowser.Model/SyncPlay/GroupStateType.cs
new file mode 100644
index 000000000..7aa454f92
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/GroupStateType.cs
@@ -0,0 +1,28 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Enum GroupState.
+ /// </summary>
+ public enum GroupStateType
+ {
+ /// <summary>
+ /// The group is in idle state. No media is playing.
+ /// </summary>
+ Idle = 0,
+
+ /// <summary>
+ /// The group is in wating state. Playback is paused. Will start playing when users are ready.
+ /// </summary>
+ Waiting = 1,
+
+ /// <summary>
+ /// The group is in paused state. Playback is paused. Will resume on play command.
+ /// </summary>
+ Paused = 2,
+
+ /// <summary>
+ /// The group is in playing state. Playback is advancing.
+ /// </summary>
+ Playing = 3
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/GroupStateUpdate.cs b/MediaBrowser.Model/SyncPlay/GroupStateUpdate.cs
new file mode 100644
index 000000000..7f7deb86b
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/GroupStateUpdate.cs
@@ -0,0 +1,31 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Class GroupStateUpdate.
+ /// </summary>
+ public class GroupStateUpdate
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="GroupStateUpdate"/> class.
+ /// </summary>
+ /// <param name="state">The state of the group.</param>
+ /// <param name="reason">The reason of the state change.</param>
+ public GroupStateUpdate(GroupStateType state, PlaybackRequestType reason)
+ {
+ State = state;
+ Reason = reason;
+ }
+
+ /// <summary>
+ /// Gets the state of the group.
+ /// </summary>
+ /// <value>The state of the group.</value>
+ public GroupStateType State { get; }
+
+ /// <summary>
+ /// Gets the reason of the state change.
+ /// </summary>
+ /// <value>The reason of the state change.</value>
+ public PlaybackRequestType Reason { get; }
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/GroupUpdate.cs b/MediaBrowser.Model/SyncPlay/GroupUpdate.cs
index 8c7208211..6f159d653 100644
--- a/MediaBrowser.Model/SyncPlay/GroupUpdate.cs
+++ b/MediaBrowser.Model/SyncPlay/GroupUpdate.cs
@@ -1,28 +1,42 @@
-#nullable disable
+using System;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class GroupUpdate.
/// </summary>
+ /// <typeparam name="T">The type of the data of the message.</typeparam>
public class GroupUpdate<T>
{
/// <summary>
- /// Gets or sets the group identifier.
+ /// Initializes a new instance of the <see cref="GroupUpdate{T}"/> class.
+ /// </summary>
+ /// <param name="groupId">The group identifier.</param>
+ /// <param name="type">The update type.</param>
+ /// <param name="data">The update data.</param>
+ public GroupUpdate(Guid groupId, GroupUpdateType type, T data)
+ {
+ GroupId = groupId;
+ Type = type;
+ Data = data;
+ }
+
+ /// <summary>
+ /// Gets the group identifier.
/// </summary>
/// <value>The group identifier.</value>
- public string GroupId { get; set; }
+ public Guid GroupId { get; }
/// <summary>
- /// Gets or sets the update type.
+ /// Gets the update type.
/// </summary>
/// <value>The update type.</value>
- public GroupUpdateType Type { get; set; }
+ public GroupUpdateType Type { get; }
/// <summary>
- /// Gets or sets the data.
+ /// Gets the update data.
/// </summary>
- /// <value>The data.</value>
- public T Data { get; set; }
+ /// <value>The update data.</value>
+ public T Data { get; }
}
}
diff --git a/MediaBrowser.Model/SyncPlay/GroupUpdateType.cs b/MediaBrowser.Model/SyncPlay/GroupUpdateType.cs
index c749f7b13..907d1defe 100644
--- a/MediaBrowser.Model/SyncPlay/GroupUpdateType.cs
+++ b/MediaBrowser.Model/SyncPlay/GroupUpdateType.cs
@@ -26,14 +26,14 @@ namespace MediaBrowser.Model.SyncPlay
GroupLeft,
/// <summary>
- /// The group-wait update. Tells members of the group that a user is buffering.
+ /// The group-state update. Tells members of the group that the state changed.
/// </summary>
- GroupWait,
+ StateUpdate,
/// <summary>
- /// The prepare-session update. Tells a user to load some content.
+ /// The play-queue update. Tells a user the playing queue of the group.
/// </summary>
- PrepareSession,
+ PlayQueue,
/// <summary>
/// The not-in-group error. Tells a user that they don't belong to a group.
diff --git a/MediaBrowser.Model/SyncPlay/JoinGroupRequest.cs b/MediaBrowser.Model/SyncPlay/JoinGroupRequest.cs
deleted file mode 100644
index 0c77a6132..000000000
--- a/MediaBrowser.Model/SyncPlay/JoinGroupRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.SyncPlay
-{
- /// <summary>
- /// Class JoinGroupRequest.
- /// </summary>
- public class JoinGroupRequest
- {
- /// <summary>
- /// Gets or sets the Group id.
- /// </summary>
- /// <value>The Group id to join.</value>
- public Guid GroupId { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs b/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs
new file mode 100644
index 000000000..a851229f7
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Class PlayQueueUpdate.
+ /// </summary>
+ public class PlayQueueUpdate
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PlayQueueUpdate"/> class.
+ /// </summary>
+ /// <param name="reason">The reason for the update.</param>
+ /// <param name="lastUpdate">The UTC time of the last change to the playing queue.</param>
+ /// <param name="playlist">The playlist.</param>
+ /// <param name="playingItemIndex">The playing item index in the playlist.</param>
+ /// <param name="startPositionTicks">The start position ticks.</param>
+ /// <param name="shuffleMode">The shuffle mode.</param>
+ /// <param name="repeatMode">The repeat mode.</param>
+ public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<QueueItem> playlist, int playingItemIndex, long startPositionTicks, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode)
+ {
+ Reason = reason;
+ LastUpdate = lastUpdate;
+ Playlist = playlist;
+ PlayingItemIndex = playingItemIndex;
+ StartPositionTicks = startPositionTicks;
+ ShuffleMode = shuffleMode;
+ RepeatMode = repeatMode;
+ }
+
+ /// <summary>
+ /// Gets the request type that originated this update.
+ /// </summary>
+ /// <value>The reason for the update.</value>
+ public PlayQueueUpdateReason Reason { get; }
+
+ /// <summary>
+ /// Gets the UTC time of the last change to the playing queue.
+ /// </summary>
+ /// <value>The UTC time of the last change to the playing queue.</value>
+ public DateTime LastUpdate { get; }
+
+ /// <summary>
+ /// Gets the playlist.
+ /// </summary>
+ /// <value>The playlist.</value>
+ public IReadOnlyList<QueueItem> Playlist { get; }
+
+ /// <summary>
+ /// Gets the playing item index in the playlist.
+ /// </summary>
+ /// <value>The playing item index in the playlist.</value>
+ public int PlayingItemIndex { get; }
+
+ /// <summary>
+ /// Gets the start position ticks.
+ /// </summary>
+ /// <value>The start position ticks.</value>
+ public long StartPositionTicks { get; }
+
+ /// <summary>
+ /// Gets the shuffle mode.
+ /// </summary>
+ /// <value>The shuffle mode.</value>
+ public GroupShuffleMode ShuffleMode { get; }
+
+ /// <summary>
+ /// Gets the repeat mode.
+ /// </summary>
+ /// <value>The repeat mode.</value>
+ public GroupRepeatMode RepeatMode { get; }
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs b/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs
new file mode 100644
index 000000000..b609f4b1b
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs
@@ -0,0 +1,58 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Enum PlayQueueUpdateReason.
+ /// </summary>
+ public enum PlayQueueUpdateReason
+ {
+ /// <summary>
+ /// A user is requesting to play a new playlist.
+ /// </summary>
+ NewPlaylist = 0,
+
+ /// <summary>
+ /// A user is changing the playing item.
+ /// </summary>
+ SetCurrentItem = 1,
+
+ /// <summary>
+ /// A user is removing items from the playlist.
+ /// </summary>
+ RemoveItems = 2,
+
+ /// <summary>
+ /// A user is moving an item in the playlist.
+ /// </summary>
+ MoveItem = 3,
+
+ /// <summary>
+ /// A user is adding items the queue.
+ /// </summary>
+ Queue = 4,
+
+ /// <summary>
+ /// A user is adding items to the queue, after the currently playing item.
+ /// </summary>
+ QueueNext = 5,
+
+ /// <summary>
+ /// A user is requesting the next item in queue.
+ /// </summary>
+ NextItem = 6,
+
+ /// <summary>
+ /// A user is requesting the previous item in queue.
+ /// </summary>
+ PreviousItem = 7,
+
+ /// <summary>
+ /// A user is changing repeat mode.
+ /// </summary>
+ RepeatMode = 8,
+
+ /// <summary>
+ /// A user is changing shuffle mode.
+ /// </summary>
+ ShuffleMode = 9
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/PlaybackRequest.cs b/MediaBrowser.Model/SyncPlay/PlaybackRequest.cs
deleted file mode 100644
index 9de23194e..000000000
--- a/MediaBrowser.Model/SyncPlay/PlaybackRequest.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.SyncPlay
-{
- /// <summary>
- /// Class PlaybackRequest.
- /// </summary>
- public class PlaybackRequest
- {
- /// <summary>
- /// Gets or sets the request type.
- /// </summary>
- /// <value>The request type.</value>
- public PlaybackRequestType Type { get; set; }
-
- /// <summary>
- /// Gets or sets when the request has been made by the client.
- /// </summary>
- /// <value>The date of the request.</value>
- public DateTime? When { get; set; }
-
- /// <summary>
- /// Gets or sets the position ticks.
- /// </summary>
- /// <value>The position ticks.</value>
- public long? PositionTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the ping time.
- /// </summary>
- /// <value>The ping time.</value>
- public long? Ping { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs b/MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs
index e89efeed8..4429623dd 100644
--- a/MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs
+++ b/MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs
@@ -6,33 +6,88 @@ namespace MediaBrowser.Model.SyncPlay
public enum PlaybackRequestType
{
/// <summary>
- /// A user is requesting a play command for the group.
+ /// A user is setting a new playlist.
/// </summary>
Play = 0,
/// <summary>
+ /// A user is changing the playlist item.
+ /// </summary>
+ SetPlaylistItem = 1,
+
+ /// <summary>
+ /// A user is removing items from the playlist.
+ /// </summary>
+ RemoveFromPlaylist = 2,
+
+ /// <summary>
+ /// A user is moving an item in the playlist.
+ /// </summary>
+ MovePlaylistItem = 3,
+
+ /// <summary>
+ /// A user is adding items to the playlist.
+ /// </summary>
+ Queue = 4,
+
+ /// <summary>
+ /// A user is requesting an unpause command for the group.
+ /// </summary>
+ Unpause = 5,
+
+ /// <summary>
/// A user is requesting a pause command for the group.
/// </summary>
- Pause = 1,
+ Pause = 6,
/// <summary>
- /// A user is requesting a seek command for the group.
+ /// A user is requesting a stop command for the group.
/// </summary>
- Seek = 2,
+ Stop = 7,
/// <summary>
+ /// A user is requesting a seek command for the group.
+ /// </summary>
+ Seek = 8,
+
+ /// <summary>
/// A user is signaling that playback is buffering.
/// </summary>
- Buffer = 3,
+ Buffer = 9,
/// <summary>
/// A user is signaling that playback resumed.
/// </summary>
- Ready = 4,
+ Ready = 10,
+
+ /// <summary>
+ /// A user is requesting next item in playlist.
+ /// </summary>
+ NextItem = 11,
+
+ /// <summary>
+ /// A user is requesting previous item in playlist.
+ /// </summary>
+ PreviousItem = 12,
+
+ /// <summary>
+ /// A user is setting the repeat mode.
+ /// </summary>
+ SetRepeatMode = 13,
+
+ /// <summary>
+ /// A user is setting the shuffle mode.
+ /// </summary>
+ SetShuffleMode = 14,
+
+ /// <summary>
+ /// A user is reporting their ping.
+ /// </summary>
+ Ping = 15,
/// <summary>
- /// A user is reporting its ping.
+ /// A user is requesting to be ignored on group wait.
/// </summary>
- Ping = 5
+ IgnoreWait = 16
}
}
diff --git a/MediaBrowser.Model/SyncPlay/QueueItem.cs b/MediaBrowser.Model/SyncPlay/QueueItem.cs
new file mode 100644
index 000000000..a6dcc109e
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/QueueItem.cs
@@ -0,0 +1,31 @@
+using System;
+
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Class QueueItem.
+ /// </summary>
+ public class QueueItem
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="QueueItem"/> class.
+ /// </summary>
+ /// <param name="itemId">The item identifier.</param>
+ public QueueItem(Guid itemId)
+ {
+ ItemId = itemId;
+ }
+
+ /// <summary>
+ /// Gets the item identifier.
+ /// </summary>
+ /// <value>The item identifier.</value>
+ public Guid ItemId { get; }
+
+ /// <summary>
+ /// Gets the playlist identifier of the item.
+ /// </summary>
+ /// <value>The playlist identifier of the item.</value>
+ public Guid PlaylistItemId { get; } = Guid.NewGuid();
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/RequestType.cs b/MediaBrowser.Model/SyncPlay/RequestType.cs
new file mode 100644
index 000000000..a6e397dcd
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/RequestType.cs
@@ -0,0 +1,33 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Enum RequestType.
+ /// </summary>
+ public enum RequestType
+ {
+ /// <summary>
+ /// A user is requesting to create a new group.
+ /// </summary>
+ NewGroup = 0,
+
+ /// <summary>
+ /// A user is requesting to join a group.
+ /// </summary>
+ JoinGroup = 1,
+
+ /// <summary>
+ /// A user is requesting to leave a group.
+ /// </summary>
+ LeaveGroup = 2,
+
+ /// <summary>
+ /// A user is requesting the list of available groups.
+ /// </summary>
+ ListGroups = 3,
+
+ /// <summary>
+ /// A user is sending a playback command to a group.
+ /// </summary>
+ Playback = 4
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/SendCommand.cs b/MediaBrowser.Model/SyncPlay/SendCommand.cs
index 0f0be0152..73cb50876 100644
--- a/MediaBrowser.Model/SyncPlay/SendCommand.cs
+++ b/MediaBrowser.Model/SyncPlay/SendCommand.cs
@@ -1,4 +1,4 @@
-#nullable disable
+using System;
namespace MediaBrowser.Model.SyncPlay
{
@@ -8,33 +8,58 @@ namespace MediaBrowser.Model.SyncPlay
public class SendCommand
{
/// <summary>
- /// Gets or sets the group identifier.
+ /// Initializes a new instance of the <see cref="SendCommand"/> class.
+ /// </summary>
+ /// <param name="groupId">The group identifier.</param>
+ /// <param name="playlistItemId">The playlist identifier of the playing item.</param>
+ /// <param name="when">The UTC time when to execute the command.</param>
+ /// <param name="command">The command.</param>
+ /// <param name="positionTicks">The position ticks, for commands that require it.</param>
+ /// <param name="emittedAt">The UTC time when this command has been emitted.</param>
+ public SendCommand(Guid groupId, Guid playlistItemId, DateTime when, SendCommandType command, long? positionTicks, DateTime emittedAt)
+ {
+ GroupId = groupId;
+ PlaylistItemId = playlistItemId;
+ When = when;
+ Command = command;
+ PositionTicks = positionTicks;
+ EmittedAt = emittedAt;
+ }
+
+ /// <summary>
+ /// Gets the group identifier.
/// </summary>
/// <value>The group identifier.</value>
- public string GroupId { get; set; }
+ public Guid GroupId { get; }
+
+ /// <summary>
+ /// Gets the playlist identifier of the playing item.
+ /// </summary>
+ /// <value>The playlist identifier of the playing item.</value>
+ public Guid PlaylistItemId { get; }
/// <summary>
/// Gets or sets the UTC time when to execute the command.
/// </summary>
/// <value>The UTC time when to execute the command.</value>
- public string When { get; set; }
+ public DateTime When { get; set; }
/// <summary>
- /// Gets or sets the position ticks.
+ /// Gets the position ticks.
/// </summary>
/// <value>The position ticks.</value>
- public long? PositionTicks { get; set; }
+ public long? PositionTicks { get; }
/// <summary>
- /// Gets or sets the command.
+ /// Gets the command.
/// </summary>
/// <value>The command.</value>
- public SendCommandType Command { get; set; }
+ public SendCommandType Command { get; }
/// <summary>
- /// Gets or sets the UTC time when this command has been emitted.
+ /// Gets the UTC time when this command has been emitted.
/// </summary>
/// <value>The UTC time when this command has been emitted.</value>
- public string EmittedAt { get; set; }
+ public DateTime EmittedAt { get; }
}
}
diff --git a/MediaBrowser.Model/SyncPlay/SendCommandType.cs b/MediaBrowser.Model/SyncPlay/SendCommandType.cs
index 86dec9e90..e6b17c60a 100644
--- a/MediaBrowser.Model/SyncPlay/SendCommandType.cs
+++ b/MediaBrowser.Model/SyncPlay/SendCommandType.cs
@@ -6,9 +6,9 @@ namespace MediaBrowser.Model.SyncPlay
public enum SendCommandType
{
/// <summary>
- /// The play command. Instructs users to start playback.
+ /// The unpause command. Instructs users to unpause playback.
/// </summary>
- Play = 0,
+ Unpause = 0,
/// <summary>
/// The pause command. Instructs users to pause playback.
@@ -16,8 +16,13 @@ namespace MediaBrowser.Model.SyncPlay
Pause = 1,
/// <summary>
+ /// The stop command. Instructs users to stop playback.
+ /// </summary>
+ Stop = 2,
+
+ /// <summary>
/// The seek command. Instructs users to seek to a specified time.
/// </summary>
- Seek = 2
+ Seek = 3
}
}
diff --git a/MediaBrowser.Model/SyncPlay/SyncPlayBroadcastType.cs b/MediaBrowser.Model/SyncPlay/SyncPlayBroadcastType.cs
new file mode 100644
index 000000000..29dbb11b3
--- /dev/null
+++ b/MediaBrowser.Model/SyncPlay/SyncPlayBroadcastType.cs
@@ -0,0 +1,28 @@
+namespace MediaBrowser.Model.SyncPlay
+{
+ /// <summary>
+ /// Used to filter the sessions of a group.
+ /// </summary>
+ public enum SyncPlayBroadcastType
+ {
+ /// <summary>
+ /// All sessions will receive the message.
+ /// </summary>
+ AllGroup = 0,
+
+ /// <summary>
+ /// Only the specified session will receive the message.
+ /// </summary>
+ CurrentSession = 1,
+
+ /// <summary>
+ /// All sessions, except the current one, will receive the message.
+ /// </summary>
+ AllExceptCurrentSession = 2,
+
+ /// <summary>
+ /// Only sessions that are not buffering will receive the message.
+ /// </summary>
+ AllReady = 3
+ }
+}
diff --git a/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs b/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
index 8ec5eaab3..219e7b1e0 100644
--- a/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
+++ b/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
@@ -1,4 +1,4 @@
-#nullable disable
+using System;
namespace MediaBrowser.Model.SyncPlay
{
@@ -8,15 +8,26 @@ namespace MediaBrowser.Model.SyncPlay
public class UtcTimeResponse
{
/// <summary>
- /// Gets or sets the UTC time when request has been received.
+ /// Initializes a new instance of the <see cref="UtcTimeResponse"/> class.
+ /// </summary>
+ /// <param name="requestReceptionTime">The UTC time when request has been received.</param>
+ /// <param name="responseTransmissionTime">The UTC time when response has been sent.</param>
+ public UtcTimeResponse(DateTime requestReceptionTime, DateTime responseTransmissionTime)
+ {
+ RequestReceptionTime = requestReceptionTime;
+ ResponseTransmissionTime = responseTransmissionTime;
+ }
+
+ /// <summary>
+ /// Gets the UTC time when request has been received.
/// </summary>
/// <value>The UTC time when request has been received.</value>
- public string RequestReceptionTime { get; set; }
+ public DateTime RequestReceptionTime { get; }
/// <summary>
- /// Gets or sets the UTC time when response has been sent.
+ /// Gets the UTC time when response has been sent.
/// </summary>
/// <value>The UTC time when response has been sent.</value>
- public string ResponseTransmissionTime { get; set; }
+ public DateTime ResponseTransmissionTime { get; }
}
}
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; }
}
}