aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Activity/ActivityLogEntry.cs1
-rw-r--r--MediaBrowser.Model/Activity/IActivityManager.cs14
-rw-r--r--MediaBrowser.Model/Activity/IActivityRepository.cs14
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs32
-rw-r--r--MediaBrowser.Model/Devices/DeviceOptions.cs9
-rw-r--r--MediaBrowser.Model/Devices/DevicesOptions.cs23
-rw-r--r--MediaBrowser.Model/Dlna/CodecProfile.cs4
-rw-r--r--MediaBrowser.Model/Dlna/ConditionProcessor.cs6
-rw-r--r--MediaBrowser.Model/Dlna/ContainerProfile.cs8
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfile.cs25
-rw-r--r--MediaBrowser.Model/Dlna/SubtitleProfile.cs5
-rw-r--r--MediaBrowser.Model/Dto/PublicUserDto.cs48
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs52
-rw-r--r--MediaBrowser.Model/Extensions/ListHelper.cs27
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj7
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs119
-rw-r--r--MediaBrowser.Model/Net/WebSocketMessage.cs8
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOptions.cs14
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs18
19 files changed, 251 insertions, 183 deletions
diff --git a/MediaBrowser.Model/Activity/ActivityLogEntry.cs b/MediaBrowser.Model/Activity/ActivityLogEntry.cs
index 80f01b66e..5ab904394 100644
--- a/MediaBrowser.Model/Activity/ActivityLogEntry.cs
+++ b/MediaBrowser.Model/Activity/ActivityLogEntry.cs
@@ -59,6 +59,7 @@ namespace MediaBrowser.Model.Activity
/// Gets or sets the user primary image tag.
/// </summary>
/// <value>The user primary image tag.</value>
+ [Obsolete("UserPrimaryImageTag is not used.")]
public string UserPrimaryImageTag { get; set; }
/// <summary>
diff --git a/MediaBrowser.Model/Activity/IActivityManager.cs b/MediaBrowser.Model/Activity/IActivityManager.cs
index f336f5272..9dab5e77b 100644
--- a/MediaBrowser.Model/Activity/IActivityManager.cs
+++ b/MediaBrowser.Model/Activity/IActivityManager.cs
@@ -1,6 +1,9 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Jellyfin.Data.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Querying;
@@ -10,10 +13,15 @@ namespace MediaBrowser.Model.Activity
{
event EventHandler<GenericEventArgs<ActivityLogEntry>> EntryCreated;
- void Create(ActivityLogEntry entry);
+ void Create(ActivityLog entry);
- QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
+ Task CreateAsync(ActivityLog entry);
- QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, bool? hasUserId, int? x, int? y);
+ QueryResult<ActivityLogEntry> GetPagedResult(int? startIndex, int? limit);
+
+ QueryResult<ActivityLogEntry> GetPagedResult(
+ Func<IQueryable<ActivityLog>, IQueryable<ActivityLog>> func,
+ int? startIndex,
+ int? limit);
}
}
diff --git a/MediaBrowser.Model/Activity/IActivityRepository.cs b/MediaBrowser.Model/Activity/IActivityRepository.cs
deleted file mode 100644
index 66144ec47..000000000
--- a/MediaBrowser.Model/Activity/IActivityRepository.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using MediaBrowser.Model.Querying;
-
-namespace MediaBrowser.Model.Activity
-{
- public interface IActivityRepository
- {
- void Create(ActivityLogEntry entry);
-
- QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, bool? z, int? startIndex, int? limit);
- }
-}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index 063ccd9b9..1f5981f10 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -49,17 +49,24 @@ namespace MediaBrowser.Model.Configuration
public int HttpsPortNumber { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether [use HTTPS].
+ /// Gets or sets a value indicating whether to use HTTPS.
/// </summary>
- /// <value><c>true</c> if [use HTTPS]; otherwise, <c>false</c>.</value>
+ /// <remarks>
+ /// In order for HTTPS to be used, in addition to setting this to true, valid values must also be
+ /// provided for <see cref="CertificatePath"/> and <see cref="CertificatePassword"/>.
+ /// </remarks>
public bool EnableHttps { get; set; }
+
public bool EnableNormalizedItemByNameIds { get; set; }
/// <summary>
- /// Gets or sets the value pointing to the file system where the ssl certificate is located..
+ /// Gets or sets the filesystem path of an X.509 certificate to use for SSL.
/// </summary>
- /// <value>The value pointing to the file system where the ssl certificate is located..</value>
public string CertificatePath { get; set; }
+
+ /// <summary>
+ /// Gets or sets the password required to access the X.509 certificate data in the file specified by <see cref="CertificatePath"/>.
+ /// </summary>
public string CertificatePassword { get; set; }
/// <summary>
@@ -69,8 +76,9 @@ namespace MediaBrowser.Model.Configuration
public bool IsPortAuthorized { get; set; }
public bool AutoRunWebApp { get; set; }
+
public bool EnableRemoteAccess { get; set; }
- public bool CameraUploadUpgraded { get; set; }
+
public bool CollectionsUpgraded { get; set; }
/// <summary>
@@ -86,6 +94,7 @@ namespace MediaBrowser.Model.Configuration
/// </summary>
/// <value>The metadata path.</value>
public string MetadataPath { get; set; }
+
public string MetadataNetworkPath { get; set; }
/// <summary>
@@ -208,15 +217,26 @@ namespace MediaBrowser.Model.Configuration
public int RemoteClientBitrateLimit { get; set; }
public bool EnableFolderView { get; set; }
+
public bool EnableGroupingIntoCollections { get; set; }
+
public bool DisplaySpecialsWithinSeasons { get; set; }
+
public string[] LocalNetworkSubnets { get; set; }
+
public string[] LocalNetworkAddresses { get; set; }
+
public string[] CodecsUsed { get; set; }
+
public bool IgnoreVirtualInterfaces { get; set; }
+
public bool EnableExternalContentInSuggestions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the server should force connections over HTTPS.
+ /// </summary>
public bool RequireHttps { get; set; }
- public bool IsBehindProxy { get; set; }
+
public bool EnableNewOmdbSupport { get; set; }
public string[] RemoteIPFilter { get; set; }
diff --git a/MediaBrowser.Model/Devices/DeviceOptions.cs b/MediaBrowser.Model/Devices/DeviceOptions.cs
new file mode 100644
index 000000000..8b77fd7fc
--- /dev/null
+++ b/MediaBrowser.Model/Devices/DeviceOptions.cs
@@ -0,0 +1,9 @@
+#pragma warning disable CS1591
+
+namespace MediaBrowser.Model.Devices
+{
+ public class DeviceOptions
+ {
+ public string CustomName { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Devices/DevicesOptions.cs b/MediaBrowser.Model/Devices/DevicesOptions.cs
deleted file mode 100644
index 02570650e..000000000
--- a/MediaBrowser.Model/Devices/DevicesOptions.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-
-namespace MediaBrowser.Model.Devices
-{
- public class DevicesOptions
- {
- public string[] EnabledCameraUploadDevices { get; set; }
- public string CameraUploadPath { get; set; }
- public bool EnableCameraUploadSubfolders { get; set; }
-
- public DevicesOptions()
- {
- EnabledCameraUploadDevices = Array.Empty<string>();
- }
- }
-
- public class DeviceOptions
- {
- public string CustomName { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs
index 756e500dd..7bb961deb 100644
--- a/MediaBrowser.Model/Dlna/CodecProfile.cs
+++ b/MediaBrowser.Model/Dlna/CodecProfile.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -57,7 +57,7 @@ namespace MediaBrowser.Model.Dlna
foreach (var val in codec)
{
- if (ListHelper.ContainsIgnoreCase(codecs, val))
+ if (codecs.Contains(val, StringComparer.OrdinalIgnoreCase))
{
return true;
}
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
index 7423efaf6..0c3bd8882 100644
--- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs
+++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Globalization;
-using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Dlna
@@ -167,9 +167,7 @@ namespace MediaBrowser.Model.Dlna
switch (condition.Condition)
{
case ProfileConditionType.EqualsAny:
- {
- return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
- }
+ return expected.Split('|').Contains(currentValue, StringComparer.OrdinalIgnoreCase);
case ProfileConditionType.Equals:
return string.Equals(currentValue, expected, StringComparison.OrdinalIgnoreCase);
case ProfileConditionType.NotEquals:
diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs
index e6691c513..cc2417a70 100644
--- a/MediaBrowser.Model/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -45,7 +45,7 @@ namespace MediaBrowser.Model.Dlna
public static bool ContainsContainer(string profileContainers, string inputContainer)
{
var isNegativeList = false;
- if (profileContainers != null && profileContainers.StartsWith("-"))
+ if (profileContainers != null && profileContainers.StartsWith("-", StringComparison.Ordinal))
{
isNegativeList = true;
profileContainers = profileContainers.Substring(1);
@@ -72,7 +72,7 @@ namespace MediaBrowser.Model.Dlna
foreach (var container in allInputContainers)
{
- if (ListHelper.ContainsIgnoreCase(profileContainers, container))
+ if (profileContainers.Contains(container, StringComparer.OrdinalIgnoreCase))
{
return false;
}
@@ -86,7 +86,7 @@ namespace MediaBrowser.Model.Dlna
foreach (var container in allInputContainers)
{
- if (ListHelper.ContainsIgnoreCase(profileContainers, container))
+ if (profileContainers.Contains(container, StringComparer.OrdinalIgnoreCase))
{
return true;
}
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs
index 0cefbbe01..3813ac5eb 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Dlna
@@ -93,14 +93,14 @@ namespace MediaBrowser.Model.Dlna
public DeviceProfile()
{
- DirectPlayProfiles = new DirectPlayProfile[] { };
- TranscodingProfiles = new TranscodingProfile[] { };
- ResponseProfiles = new ResponseProfile[] { };
- CodecProfiles = new CodecProfile[] { };
- ContainerProfiles = new ContainerProfile[] { };
+ 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 = new XmlAttribute[] { };
+ XmlRootAttributes = Array.Empty<XmlAttribute>();
SupportedMediaTypes = "Audio,Photo,Video";
MaxStreamingBitrate = 8000000;
@@ -129,13 +129,14 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
+ if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
return i;
}
+
return null;
}
@@ -155,7 +156,7 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
+ if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
@@ -185,7 +186,7 @@ namespace MediaBrowser.Model.Dlna
}
var audioCodecs = i.GetAudioCodecs();
- if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
+ if (audioCodecs.Length > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
@@ -288,13 +289,13 @@ namespace MediaBrowser.Model.Dlna
}
var audioCodecs = i.GetAudioCodecs();
- if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
+ if (audioCodecs.Length > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
var videoCodecs = i.GetVideoCodecs();
- if (videoCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
+ if (videoCodecs.Length > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
index 6a8f655ac..9c28019aa 100644
--- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs
+++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
@@ -1,7 +1,8 @@
#pragma warning disable CS1591
+using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -40,7 +41,7 @@ namespace MediaBrowser.Model.Dlna
}
var languages = GetLanguages();
- return languages.Length == 0 || ListHelper.ContainsIgnoreCase(languages, subLanguage);
+ return languages.Length == 0 || languages.Contains(subLanguage, StringComparer.OrdinalIgnoreCase);
}
}
}
diff --git a/MediaBrowser.Model/Dto/PublicUserDto.cs b/MediaBrowser.Model/Dto/PublicUserDto.cs
new file mode 100644
index 000000000..b6bfaf2e9
--- /dev/null
+++ b/MediaBrowser.Model/Dto/PublicUserDto.cs
@@ -0,0 +1,48 @@
+using System;
+
+namespace MediaBrowser.Model.Dto
+{
+ /// <summary>
+ /// Class PublicUserDto. Its goal is to show only public information about a user
+ /// </summary>
+ public class PublicUserDto : IItemDto
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the primary image tag.
+ /// </summary>
+ /// <value>The primary image tag.</value>
+ public string PrimaryImageTag { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance has password.
+ /// </summary>
+ /// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
+ public bool HasPassword { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance has configured password.
+ /// Note that in this case this method should not be here, but it is necessary when changing password at the
+ /// first login.
+ /// </summary>
+ /// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
+ public bool HasConfiguredPassword { get; set; }
+
+ /// <summary>
+ /// Gets or sets the primary image aspect ratio.
+ /// </summary>
+ /// <value>The primary image aspect ratio.</value>
+ public double? PrimaryImageAspectRatio { get; set; }
+
+ /// <inheritdoc />
+ public override string ToString()
+ {
+ return Name ?? base.ToString();
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index e7e8d7cec..ac33f1da4 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -34,8 +34,22 @@ namespace MediaBrowser.Model.Entities
/// <value>The language.</value>
public string Language { get; set; }
+ /// <summary>
+ /// Gets or sets the color transfer.
+ /// </summary>
+ /// <value>The color transfer.</value>
public string ColorTransfer { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color primaries.
+ /// </summary>
+ /// <value>The color primaries.</value>
public string ColorPrimaries { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color space.
+ /// </summary>
+ /// <value>The color space.</value>
public string ColorSpace { get; set; }
/// <summary>
@@ -44,11 +58,28 @@ namespace MediaBrowser.Model.Entities
/// <value>The comment.</value>
public string Comment { get; set; }
+ /// <summary>
+ /// Gets or sets the time base.
+ /// </summary>
+ /// <value>The time base.</value>
public string TimeBase { get; set; }
+
+ /// <summary>
+ /// Gets or sets the codec time base.
+ /// </summary>
+ /// <value>The codec time base.</value>
public string CodecTimeBase { get; set; }
+ /// <summary>
+ /// Gets or sets the title.
+ /// </summary>
+ /// <value>The title.</value>
public string Title { get; set; }
+ /// <summary>
+ /// Gets or sets the video range.
+ /// </summary>
+ /// <value>The video range.</value>
public string VideoRange
{
get
@@ -60,7 +91,8 @@ namespace MediaBrowser.Model.Entities
var colorTransfer = ColorTransfer;
- if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase))
+ if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(colorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase))
{
return "HDR";
}
@@ -70,7 +102,9 @@ namespace MediaBrowser.Model.Entities
}
public string localizedUndefined { get; set; }
+
public string localizedDefault { get; set; }
+
public string localizedForced { get; set; }
public string DisplayTitle
@@ -197,34 +231,34 @@ namespace MediaBrowser.Model.Entities
{
if (i.IsInterlaced)
{
- return "1440I";
+ return "1440i";
}
- return "1440P";
+ return "1440p";
}
if (width >= 1900 || height >= 1000)
{
if (i.IsInterlaced)
{
- return "1080I";
+ return "1080i";
}
- return "1080P";
+ return "1080p";
}
if (width >= 1260 || height >= 700)
{
if (i.IsInterlaced)
{
- return "720I";
+ return "720i";
}
- return "720P";
+ return "720p";
}
if (width >= 700 || height >= 440)
{
if (i.IsInterlaced)
{
- return "480I";
+ return "480i";
}
- return "480P";
+ return "480p";
}
return "SD";
diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.cs
deleted file mode 100644
index 90ce6f2e5..000000000
--- a/MediaBrowser.Model/Extensions/ListHelper.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-
-namespace MediaBrowser.Model.Extensions
-{
- // TODO: @bond remove
- public static class ListHelper
- {
- public static bool ContainsIgnoreCase(string[] list, string value)
- {
- if (value == null)
- {
- throw new ArgumentNullException(nameof(value));
- }
-
- foreach (var item in list)
- {
- if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
- }
- return false;
- }
- }
-}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index b41d0af1d..461f59672 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -21,9 +21,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
- <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.3" />
+ <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.4" />
<PackageReference Include="System.Globalization" Version="4.3.0" />
- <PackageReference Include="System.Text.Json" Version="4.7.1" />
+ <PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>
<ItemGroup>
@@ -37,6 +37,9 @@
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Jellyfin.Data\Jellyfin.Data.csproj" />
+ </ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index 06efedb30..b6d7b4245 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -17,115 +17,134 @@ namespace MediaBrowser.Model.Net
/// </summary>
private static readonly HashSet<string> _videoFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
- ".mkv",
- ".m2t",
- ".m2ts",
+ ".3gp",
+ ".asf",
+ ".avi",
+ ".divx",
+ ".dvr-ms",
+ ".f4v",
+ ".flv",
".img",
".iso",
+ ".m2t",
+ ".m2ts",
+ ".m2v",
+ ".m4v",
".mk3d",
- ".ts",
- ".rmvb",
+ ".mkv",
".mov",
- ".avi",
+ ".mp4",
".mpg",
".mpeg",
- ".wmv",
- ".mp4",
- ".divx",
- ".dvr-ms",
- ".wtv",
+ ".mts",
+ ".ogg",
".ogm",
".ogv",
- ".asf",
- ".m4v",
- ".flv",
- ".f4v",
- ".3gp",
+ ".rec",
+ ".ts",
+ ".rmvb",
".webm",
- ".mts",
- ".m2v",
- ".rec"
+ ".wmv",
+ ".wtv",
};
// http://en.wikipedia.org/wiki/Internet_media_type
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
+ // http://www.iana.org/assignments/media-types/media-types.xhtml
// Add more as needed
private static readonly Dictionary<string, string> _mimeTypeLookup = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
// Type application
+ { ".7z", "application/x-7z-compressed" },
+ { ".azw", "application/vnd.amazon.ebook" },
+ { ".azw3", "application/vnd.amazon.ebook" },
{ ".cbz", "application/x-cbz" },
{ ".cbr", "application/epub+zip" },
{ ".eot", "application/vnd.ms-fontobject" },
{ ".epub", "application/epub+zip" },
{ ".js", "application/x-javascript" },
{ ".json", "application/json" },
+ { ".m3u8", "application/x-mpegURL" },
{ ".map", "application/x-javascript" },
+ { ".mobi", "application/x-mobipocket-ebook" },
+ { ".opf", "application/oebps-package+xml" },
{ ".pdf", "application/pdf" },
+ { ".rar", "application/vnd.rar" },
+ { ".srt", "application/x-subrip" },
{ ".ttml", "application/ttml+xml" },
- { ".m3u8", "application/x-mpegURL" },
- { ".mobi", "application/x-mobipocket-ebook" },
- { ".xml", "application/xml" },
{ ".wasm", "application/wasm" },
+ { ".xml", "application/xml" },
+ { ".zip", "application/zip" },
// Type image
+ { ".bmp", "image/bmp" },
+ { ".gif", "image/gif" },
+ { ".ico", "image/vnd.microsoft.icon" },
{ ".jpg", "image/jpeg" },
{ ".jpeg", "image/jpeg" },
- { ".tbn", "image/jpeg" },
{ ".png", "image/png" },
- { ".gif", "image/gif" },
- { ".tiff", "image/tiff" },
- { ".webp", "image/webp" },
- { ".ico", "image/vnd.microsoft.icon" },
{ ".svg", "image/svg+xml" },
{ ".svgz", "image/svg+xml" },
+ { ".tbn", "image/jpeg" },
+ { ".tif", "image/tiff" },
+ { ".tiff", "image/tiff" },
+ { ".webp", "image/webp" },
// Type font
{ ".ttf" , "font/ttf" },
{ ".woff" , "font/woff" },
+ { ".woff2" , "font/woff2" },
// Type text
{ ".ass", "text/x-ssa" },
{ ".ssa", "text/x-ssa" },
{ ".css", "text/css" },
{ ".csv", "text/csv" },
+ { ".edl", "text/plain" },
+ { ".rtf", "text/rtf" },
{ ".txt", "text/plain" },
{ ".vtt", "text/vtt" },
// Type video
- { ".mpg", "video/mpeg" },
- { ".ogv", "video/ogg" },
- { ".mov", "video/quicktime" },
- { ".webm", "video/webm" },
- { ".mkv", "video/x-matroska" },
- { ".wmv", "video/x-ms-wmv" },
- { ".flv", "video/x-flv" },
- { ".avi", "video/x-msvideo" },
- { ".asf", "video/x-ms-asf" },
- { ".m4v", "video/x-m4v" },
- { ".m4s", "video/mp4" },
{ ".3gp", "video/3gpp" },
{ ".3g2", "video/3gpp2" },
+ { ".asf", "video/x-ms-asf" },
+ { ".avi", "video/x-msvideo" },
+ { ".flv", "video/x-flv" },
+ { ".mp4", "video/mp4" },
+ { ".m4s", "video/mp4" },
+ { ".m4v", "video/x-m4v" },
+ { ".mpegts", "video/mp2t" },
+ { ".mpg", "video/mpeg" },
+ { ".mkv", "video/x-matroska" },
+ { ".mov", "video/quicktime" },
{ ".mpd", "video/vnd.mpeg.dash.mpd" },
+ { ".ogv", "video/ogg" },
{ ".ts", "video/mp2t" },
- { ".mpegts", "video/mp2t" },
+ { ".webm", "video/webm" },
+ { ".wmv", "video/x-ms-wmv" },
// Type audio
- { ".mp3", "audio/mpeg" },
- { ".m4a", "audio/mp4" },
{ ".aac", "audio/mp4" },
- { ".webma", "audio/webm" },
- { ".wav", "audio/wav" },
- { ".wma", "audio/x-ms-wma" },
- { ".ogg", "audio/ogg" },
- { ".oga", "audio/ogg" },
- { ".opus", "audio/ogg" },
{ ".ac3", "audio/ac3" },
+ { ".ape", "audio/x-ape" },
{ ".dsf", "audio/dsf" },
- { ".m4b", "audio/m4b" },
- { ".xsp", "audio/xsp" },
{ ".dsp", "audio/dsp" },
{ ".flac", "audio/flac" },
- { ".ape", "audio/x-ape" },
+ { ".m4a", "audio/mp4" },
+ { ".m4b", "audio/m4b" },
+ { ".mid", "audio/midi" },
+ { ".midi", "audio/midi" },
+ { ".mp3", "audio/mpeg" },
+ { ".oga", "audio/ogg" },
+ { ".ogg", "audio/ogg" },
+ { ".opus", "audio/ogg" },
+ { ".vorbis", "audio/vorbis" },
+ { ".wav", "audio/wav" },
+ { ".webma", "audio/webm" },
+ { ".wma", "audio/x-ms-wma" },
{ ".wv", "audio/x-wavpack" },
+ { ".xsp", "audio/xsp" },
};
private static readonly Dictionary<string, string> _extensionLookup = CreateExtensionLookup();
diff --git a/MediaBrowser.Model/Net/WebSocketMessage.cs b/MediaBrowser.Model/Net/WebSocketMessage.cs
index 7575224d4..03f03e4cc 100644
--- a/MediaBrowser.Model/Net/WebSocketMessage.cs
+++ b/MediaBrowser.Model/Net/WebSocketMessage.cs
@@ -1,5 +1,8 @@
+
#pragma warning disable CS1591
+using System;
+
namespace MediaBrowser.Model.Net
{
/// <summary>
@@ -13,7 +16,9 @@ namespace MediaBrowser.Model.Net
/// </summary>
/// <value>The type of the message.</value>
public string MessageType { get; set; }
- public string MessageId { get; set; }
+
+ public Guid MessageId { get; set; }
+
public string ServerId { get; set; }
/// <summary>
@@ -22,5 +27,4 @@ namespace MediaBrowser.Model.Net
/// <value>The data.</value>
public T Data { get; set; }
}
-
}
diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.cs
index 79a128e9b..9c54bd70e 100644
--- a/MediaBrowser.Model/Notifications/NotificationOptions.cs
+++ b/MediaBrowser.Model/Notifications/NotificationOptions.cs
@@ -1,7 +1,7 @@
#pragma warning disable CS1591
using System;
-using MediaBrowser.Model.Extensions;
+using System.Linq;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Model.Notifications
@@ -81,8 +81,12 @@ namespace MediaBrowser.Model.Notifications
{
foreach (NotificationOption i in Options)
{
- if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase)) return i;
+ if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase))
+ {
+ return i;
+ }
}
+
return null;
}
@@ -98,7 +102,7 @@ namespace MediaBrowser.Model.Notifications
NotificationOption opt = GetOptions(notificationType);
return opt == null ||
- !ListHelper.ContainsIgnoreCase(opt.DisabledServices, service);
+ !opt.DisabledServices.Contains(service, StringComparer.OrdinalIgnoreCase);
}
public bool IsEnabledToMonitorUser(string type, Guid userId)
@@ -106,7 +110,7 @@ namespace MediaBrowser.Model.Notifications
NotificationOption opt = GetOptions(type);
return opt != null && opt.Enabled &&
- !ListHelper.ContainsIgnoreCase(opt.DisabledMonitorUsers, userId.ToString(""));
+ !opt.DisabledMonitorUsers.Contains(userId.ToString(""), StringComparer.OrdinalIgnoreCase);
}
public bool IsEnabledToSendToUser(string type, string userId, UserPolicy userPolicy)
@@ -125,7 +129,7 @@ namespace MediaBrowser.Model.Notifications
return true;
}
- return ListHelper.ContainsIgnoreCase(opt.SendToUsers, userId);
+ return opt.SendToUsers.Contains(userId, StringComparer.OrdinalIgnoreCase);
}
return false;
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index 3d543039e..f2c5aa1e3 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -116,24 +116,6 @@ namespace MediaBrowser.Model.System
public string TranscodingTempPath { get; set; }
/// <summary>
- /// Gets or sets the HTTP server port number.
- /// </summary>
- /// <value>The HTTP server port number.</value>
- public int HttpServerPortNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [enable HTTPS].
- /// </summary>
- /// <value><c>true</c> if [enable HTTPS]; otherwise, <c>false</c>.</value>
- public bool SupportsHttps { get; set; }
-
- /// <summary>
- /// Gets or sets the HTTPS server port number.
- /// </summary>
- /// <value>The HTTPS server port number.</value>
- public int HttpsPortNumber { get; set; }
-
- /// <summary>
/// Gets or sets a value indicating whether this instance has update available.
/// </summary>
/// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>