aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Branding/BrandingOptions.cs2
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs18
-rw-r--r--MediaBrowser.Model/Dto/ImageOptions.cs111
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj18
-rw-r--r--MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs39
-rw-r--r--MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs15
-rw-r--r--MediaBrowser.Model/Notifications/NotificationLevel.cs11
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOption.cs55
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOptions.cs131
-rw-r--r--MediaBrowser.Model/Notifications/NotificationRequest.cs35
-rw-r--r--MediaBrowser.Model/Notifications/NotificationTypeInfo.cs18
-rw-r--r--MediaBrowser.Model/Notifications/SendToUserType.cs11
-rw-r--r--MediaBrowser.Model/System/OperatingSystemId.cs12
-rw-r--r--MediaBrowser.Model/System/PublicSystemInfo.cs5
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs6
15 files changed, 31 insertions, 456 deletions
diff --git a/MediaBrowser.Model/Branding/BrandingOptions.cs b/MediaBrowser.Model/Branding/BrandingOptions.cs
index 695267d46..c6580598b 100644
--- a/MediaBrowser.Model/Branding/BrandingOptions.cs
+++ b/MediaBrowser.Model/Branding/BrandingOptions.cs
@@ -22,7 +22,7 @@ public class BrandingOptions
/// <summary>
/// Gets or sets a value indicating whether to enable the splashscreen.
/// </summary>
- public bool SplashscreenEnabled { get; set; } = true;
+ public bool SplashscreenEnabled { get; set; } = false;
/// <summary>
/// Gets or sets the splashscreen location on disk.
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index bb41c9979..eb6d60295 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -118,7 +118,7 @@ namespace MediaBrowser.Model.Dlna
var transcodeReasons = directPlayInfo.TranscodeReasons;
var inputAudioChannels = audioStream?.Channels;
- var inputAudioBitrate = audioStream?.BitDepth;
+ var inputAudioBitrate = audioStream?.BitRate;
var inputAudioSampleRate = audioStream?.SampleRate;
var inputAudioBitDepth = audioStream?.BitDepth;
@@ -143,7 +143,7 @@ namespace MediaBrowser.Model.Dlna
{
if (tcProfile.Type == playlistItem.MediaType
&& tcProfile.Context == options.Context
- && _transcoderSupport.CanEncodeToAudioCodec(transcodingProfile.AudioCodec ?? tcProfile.Container))
+ && _transcoderSupport.CanEncodeToAudioCodec(tcProfile.AudioCodec ?? tcProfile.Container))
{
transcodingProfile = tcProfile;
break;
@@ -1174,7 +1174,6 @@ namespace MediaBrowser.Model.Dlna
var reason = a & flag;
if (reason != 0)
{
- a = reason;
return index;
}
@@ -1184,6 +1183,8 @@ namespace MediaBrowser.Model.Dlna
return index;
};
+ var containerSupported = false;
+
// Check DirectPlay profiles to see if it can be direct played
var analyzedProfiles = profile.DirectPlayProfiles
.Where(directPlayProfile => directPlayProfile.Type == DlnaProfileType.Video)
@@ -1197,6 +1198,10 @@ namespace MediaBrowser.Model.Dlna
{
directPlayProfileReasons |= TranscodeReason.ContainerNotSupported;
}
+ else
+ {
+ containerSupported = true;
+ }
// Check video codec
string videoCodec = videoStream?.Codec;
@@ -1239,7 +1244,7 @@ namespace MediaBrowser.Model.Dlna
{
playMethod = PlayMethod.DirectPlay;
}
- else if (directStreamFailureReasons == 0 && isEligibleForDirectStream && mediaSource.SupportsDirectStream && directPlayProfile is not null)
+ else if (directStreamFailureReasons == 0 && isEligibleForDirectStream && mediaSource.SupportsDirectStream)
{
playMethod = PlayMethod.DirectStream;
}
@@ -1261,7 +1266,10 @@ namespace MediaBrowser.Model.Dlna
return profileMatch;
}
- var failureReasons = analyzedProfiles[false].Select(analysis => analysis.Result).FirstOrDefault().TranscodeReason;
+ var failureReasons = analyzedProfiles[false]
+ .Select(analysis => analysis.Result)
+ .Where(result => !containerSupported || (result.TranscodeReason & TranscodeReason.ContainerNotSupported) == 0)
+ .FirstOrDefault().TranscodeReason;
if (failureReasons == 0)
{
failureReasons = TranscodeReason.DirectPlayError;
diff --git a/MediaBrowser.Model/Dto/ImageOptions.cs b/MediaBrowser.Model/Dto/ImageOptions.cs
deleted file mode 100644
index 3f4405f1e..000000000
--- a/MediaBrowser.Model/Dto/ImageOptions.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-#nullable disable
-using MediaBrowser.Model.Drawing;
-using MediaBrowser.Model.Entities;
-
-namespace MediaBrowser.Model.Dto
-{
- /// <summary>
- /// Class ImageOptions.
- /// </summary>
- public class ImageOptions
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="ImageOptions" /> class.
- /// </summary>
- public ImageOptions()
- {
- EnableImageEnhancers = true;
- }
-
- /// <summary>
- /// Gets or sets the type of the image.
- /// </summary>
- /// <value>The type of the image.</value>
- public ImageType ImageType { get; set; }
-
- /// <summary>
- /// Gets or sets the index of the image.
- /// </summary>
- /// <value>The index of the image.</value>
- public int? ImageIndex { get; set; }
-
- /// <summary>
- /// Gets or sets the width.
- /// </summary>
- /// <value>The width.</value>
- public int? Width { get; set; }
-
- /// <summary>
- /// Gets or sets the height.
- /// </summary>
- /// <value>The height.</value>
- public int? Height { get; set; }
-
- /// <summary>
- /// Gets or sets the width of the max.
- /// </summary>
- /// <value>The width of the max.</value>
- public int? MaxWidth { get; set; }
-
- /// <summary>
- /// Gets or sets the height of the max.
- /// </summary>
- /// <value>The height of the max.</value>
- public int? MaxHeight { get; set; }
-
- /// <summary>
- /// Gets or sets the quality.
- /// </summary>
- /// <value>The quality.</value>
- public int? Quality { get; set; }
-
- /// <summary>
- /// Gets or sets the image tag.
- /// If set this will result in strong, unconditional response caching.
- /// </summary>
- /// <value>The hash.</value>
- public string Tag { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [crop whitespace].
- /// </summary>
- /// <value><c>null</c> if [crop whitespace] contains no value, <c>true</c> if [crop whitespace]; otherwise, <c>false</c>.</value>
- public bool? CropWhitespace { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [enable image enhancers].
- /// </summary>
- /// <value><c>true</c> if [enable image enhancers]; otherwise, <c>false</c>.</value>
- public bool EnableImageEnhancers { get; set; }
-
- /// <summary>
- /// Gets or sets the format.
- /// </summary>
- /// <value>The format.</value>
- public ImageFormat? Format { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether [add played indicator].
- /// </summary>
- /// <value><c>true</c> if [add played indicator]; otherwise, <c>false</c>.</value>
- public bool AddPlayedIndicator { get; set; }
-
- /// <summary>
- /// Gets or sets the percent played.
- /// </summary>
- /// <value>The percent played.</value>
- public int? PercentPlayed { get; set; }
-
- /// <summary>
- /// Gets or sets the un played count.
- /// </summary>
- /// <value>The un played count.</value>
- public int? UnPlayedCount { get; set; }
-
- /// <summary>
- /// Gets or sets the color of the background.
- /// </summary>
- /// <value>The color of the background.</value>
- public string BackgroundColor { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 521ba0f10..9a5804485 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -33,14 +33,14 @@
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
- <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
- <PackageReference Include="MimeTypes" Version="2.4.0">
+ <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
+ <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
+ <PackageReference Include="MimeTypes">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
- <PackageReference Include="System.Globalization" Version="4.3.0" />
- <PackageReference Include="System.Text.Json" Version="7.0.1" />
+ <PackageReference Include="System.Globalization" />
+ <PackageReference Include="System.Text.Json" />
</ItemGroup>
<ItemGroup>
@@ -49,13 +49,13 @@
<!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
- <PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4">
+ <PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
- <PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
- <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
- <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
+ <PackageReference Include="SerilogAnalyzer" PrivateAssets="All" />
+ <PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
+ <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Jellyfin.Data/Jellyfin.Data.csproj" />
diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
deleted file mode 100644
index 83f982a5c..000000000
--- a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-#nullable disable
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Entities;
-
-namespace MediaBrowser.Model.MediaInfo
-{
- /// <summary>
- /// Represents the result of BDInfo output.
- /// </summary>
- public class BlurayDiscInfo
- {
- /// <summary>
- /// Gets or sets the media streams.
- /// </summary>
- /// <value>The media streams.</value>
- public MediaStream[] MediaStreams { get; set; }
-
- /// <summary>
- /// Gets or sets the run time ticks.
- /// </summary>
- /// <value>The run time ticks.</value>
- public long? RunTimeTicks { get; set; }
-
- /// <summary>
- /// Gets or sets the files.
- /// </summary>
- /// <value>The files.</value>
- public string[] Files { get; set; }
-
- public string PlaylistName { get; set; }
-
- /// <summary>
- /// Gets or sets the chapters.
- /// </summary>
- /// <value>The chapters.</value>
- public double[] Chapters { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs b/MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs
deleted file mode 100644
index 5b7d1d03c..000000000
--- a/MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace MediaBrowser.Model.MediaInfo
-{
- /// <summary>
- /// Interface IBlurayExaminer.
- /// </summary>
- public interface IBlurayExaminer
- {
- /// <summary>
- /// Gets the disc info.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <returns>BlurayDiscInfo.</returns>
- BlurayDiscInfo GetDiscInfo(string path);
- }
-}
diff --git a/MediaBrowser.Model/Notifications/NotificationLevel.cs b/MediaBrowser.Model/Notifications/NotificationLevel.cs
deleted file mode 100644
index 14fead3f0..000000000
--- a/MediaBrowser.Model/Notifications/NotificationLevel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Notifications
-{
- public enum NotificationLevel
- {
- Normal = 0,
- Warning = 1,
- Error = 2
- }
-}
diff --git a/MediaBrowser.Model/Notifications/NotificationOption.cs b/MediaBrowser.Model/Notifications/NotificationOption.cs
deleted file mode 100644
index 58aecb3d3..000000000
--- a/MediaBrowser.Model/Notifications/NotificationOption.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-#pragma warning disable CA1819 // Properties should not return arrays
-#pragma warning disable CS1591
-
-using System;
-
-namespace MediaBrowser.Model.Notifications
-{
- public class NotificationOption
- {
- public NotificationOption(string type)
- {
- Type = type;
- DisabledServices = Array.Empty<string>();
- DisabledMonitorUsers = Array.Empty<string>();
- SendToUsers = Array.Empty<string>();
- }
-
- public NotificationOption()
- {
- DisabledServices = Array.Empty<string>();
- DisabledMonitorUsers = Array.Empty<string>();
- SendToUsers = Array.Empty<string>();
- }
-
- public string? Type { get; set; }
-
- /// <summary>
- /// Gets or sets user Ids to not monitor (it's opt out).
- /// </summary>
- public string[] DisabledMonitorUsers { get; set; }
-
- /// <summary>
- /// Gets or sets user Ids to send to (if SendToUserMode == Custom).
- /// </summary>
- public string[] SendToUsers { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this <see cref="NotificationOption"/> is enabled.
- /// </summary>
- /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
- public bool Enabled { get; set; }
-
- /// <summary>
- /// Gets or sets the disabled services.
- /// </summary>
- /// <value>The disabled services.</value>
- public string[] DisabledServices { get; set; }
-
- /// <summary>
- /// Gets or sets the send to user mode.
- /// </summary>
- /// <value>The send to user mode.</value>
- public SendToUserType SendToUserMode { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.cs
deleted file mode 100644
index 804f51e16..000000000
--- a/MediaBrowser.Model/Notifications/NotificationOptions.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-#nullable disable
-#pragma warning disable CS1591
-
-using System;
-using Jellyfin.Data.Entities;
-using Jellyfin.Data.Enums;
-using Jellyfin.Extensions;
-
-namespace MediaBrowser.Model.Notifications
-{
- public class NotificationOptions
- {
- public NotificationOptions()
- {
- Options = new[]
- {
- new NotificationOption(NotificationType.TaskFailed.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.ServerRestartRequired.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.ApplicationUpdateAvailable.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.ApplicationUpdateInstalled.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.PluginUpdateInstalled.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.PluginUninstalled.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.InstallationFailed.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.PluginInstalled.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.PluginError.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- },
- new NotificationOption(NotificationType.UserLockedOut.ToString())
- {
- Enabled = true,
- SendToUserMode = SendToUserType.Admins
- }
- };
- }
-
- public NotificationOption[] Options { get; set; }
-
- public NotificationOption GetOptions(string type)
- {
- foreach (NotificationOption i in Options)
- {
- if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase))
- {
- return i;
- }
- }
-
- return null;
- }
-
- public bool IsEnabled(string type)
- {
- NotificationOption opt = GetOptions(type);
-
- return opt is not null && opt.Enabled;
- }
-
- public bool IsServiceEnabled(string service, string notificationType)
- {
- NotificationOption opt = GetOptions(notificationType);
-
- return opt is null
- || !opt.DisabledServices.Contains(service, StringComparison.OrdinalIgnoreCase);
- }
-
- public bool IsEnabledToMonitorUser(string type, Guid userId)
- {
- NotificationOption opt = GetOptions(type);
-
- return opt is not null
- && opt.Enabled
- && !opt.DisabledMonitorUsers.Contains(userId.ToString("N"), StringComparison.OrdinalIgnoreCase);
- }
-
- public bool IsEnabledToSendToUser(string type, string userId, User user)
- {
- NotificationOption opt = GetOptions(type);
-
- if (opt is not null && opt.Enabled)
- {
- if (opt.SendToUserMode == SendToUserType.All)
- {
- return true;
- }
-
- if (opt.SendToUserMode == SendToUserType.Admins && user.HasPermission(PermissionKind.IsAdministrator))
- {
- return true;
- }
-
- return opt.SendToUsers.Contains(userId, StringComparison.OrdinalIgnoreCase);
- }
-
- return false;
- }
- }
-}
diff --git a/MediaBrowser.Model/Notifications/NotificationRequest.cs b/MediaBrowser.Model/Notifications/NotificationRequest.cs
deleted file mode 100644
index 622c50cd8..000000000
--- a/MediaBrowser.Model/Notifications/NotificationRequest.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-#nullable disable
-#pragma warning disable CS1591
-
-using System;
-
-namespace MediaBrowser.Model.Notifications
-{
- public class NotificationRequest
- {
- public NotificationRequest()
- {
- UserIds = Array.Empty<Guid>();
- Date = DateTime.UtcNow;
- }
-
- public string Name { get; set; }
-
- public string Description { get; set; }
-
- public string Url { get; set; }
-
- public NotificationLevel Level { get; set; }
-
- public Guid[] UserIds { get; set; }
-
- public DateTime Date { get; set; }
-
- /// <summary>
- /// Gets or sets the corresponding type name used in configuration. Not for display.
- /// </summary>
- public string NotificationType { get; set; }
-
- public SendToUserType? SendToUserMode { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
deleted file mode 100644
index 402fbe81a..000000000
--- a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-#nullable disable
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Notifications
-{
- public class NotificationTypeInfo
- {
- public string Type { get; set; }
-
- public string Name { get; set; }
-
- public bool Enabled { get; set; }
-
- public string Category { get; set; }
-
- public bool IsBasedOnUserEvent { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Notifications/SendToUserType.cs b/MediaBrowser.Model/Notifications/SendToUserType.cs
deleted file mode 100644
index 65fc4e1ab..000000000
--- a/MediaBrowser.Model/Notifications/SendToUserType.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Notifications
-{
- public enum SendToUserType
- {
- All = 0,
- Admins = 1,
- Custom = 2
- }
-}
diff --git a/MediaBrowser.Model/System/OperatingSystemId.cs b/MediaBrowser.Model/System/OperatingSystemId.cs
deleted file mode 100644
index 2e417f6b5..000000000
--- a/MediaBrowser.Model/System/OperatingSystemId.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.System
-{
- public enum OperatingSystemId
- {
- Windows,
- Linux,
- Darwin,
- BSD
- }
-}
diff --git a/MediaBrowser.Model/System/PublicSystemInfo.cs b/MediaBrowser.Model/System/PublicSystemInfo.cs
index 53030843a..31a895642 100644
--- a/MediaBrowser.Model/System/PublicSystemInfo.cs
+++ b/MediaBrowser.Model/System/PublicSystemInfo.cs
@@ -1,6 +1,8 @@
#nullable disable
#pragma warning disable CS1591
+using System;
+
namespace MediaBrowser.Model.System
{
public class PublicSystemInfo
@@ -32,7 +34,8 @@ namespace MediaBrowser.Model.System
/// Gets or sets the operating system.
/// </summary>
/// <value>The operating system.</value>
- public string OperatingSystem { get; set; }
+ [Obsolete("This is no longer set")]
+ public string OperatingSystem { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the id.
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index 9e56849c7..bd0099af7 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -42,7 +42,8 @@ namespace MediaBrowser.Model.System
/// Gets or sets the display name of the operating system.
/// </summary>
/// <value>The display name of the operating system.</value>
- public string OperatingSystemDisplayName { get; set; }
+ [Obsolete("This is no longer set")]
+ public string OperatingSystemDisplayName { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the package name.
@@ -137,6 +138,7 @@ namespace MediaBrowser.Model.System
[Obsolete("This isn't set correctly anymore")]
public FFmpegLocation EncoderLocation { get; set; }
- public Architecture SystemArchitecture { get; set; }
+ [Obsolete("This is no longer set")]
+ public Architecture SystemArchitecture { get; set; } = Architecture.X64;
}
}