diff options
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Dlna/DlnaProfileType.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/MediaStream.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Model/IO/IFileSystem.cs | 14 | ||||
| -rw-r--r-- | MediaBrowser.Model/MediaBrowser.Model.csproj | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/Net/ISocketFactory.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/Querying/ItemSortBy.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Querying/NextUpQuery.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Session/GeneralCommand.cs | 26 | ||||
| -rw-r--r-- | MediaBrowser.Model/Session/HardwareEncodingType.cs | 18 |
9 files changed, 60 insertions, 31 deletions
diff --git a/MediaBrowser.Model/Dlna/DlnaProfileType.cs b/MediaBrowser.Model/Dlna/DlnaProfileType.cs index e30ed0f3c..c1a663bf1 100644 --- a/MediaBrowser.Model/Dlna/DlnaProfileType.cs +++ b/MediaBrowser.Model/Dlna/DlnaProfileType.cs @@ -6,6 +6,7 @@ namespace MediaBrowser.Model.Dlna { Audio = 0, Video = 1, - Photo = 2 + Photo = 2, + Subtitle = 3 } } diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 38ac44794..e2616d92a 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; +using Jellyfin.Extensions; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.MediaInfo; @@ -17,6 +18,18 @@ namespace MediaBrowser.Model.Entities /// </summary> public class MediaStream { + private static readonly string[] _specialCodes = + { + // Uncoded languages. + "mis", + // Multiple languages. + "mul", + // Undetermined. + "und", + // No linguistic content; not applicable. + "zxx" + }; + /// <summary> /// Gets or sets the codec. /// </summary> @@ -137,7 +150,8 @@ namespace MediaBrowser.Model.Entities { var attributes = new List<string>(); - if (!string.IsNullOrEmpty(Language)) + // Do not display the language code in display titles if unset or set to a special code. Show it in all other cases (possibly expanded). + if (!string.IsNullOrEmpty(Language) && !_specialCodes.Contains(Language, StringComparison.OrdinalIgnoreCase)) { // Get full language string i.e. eng -> English. Will not work for some languages which use ISO 639-2/B instead of /T codes. string fullLanguage = CultureInfo @@ -147,7 +161,7 @@ namespace MediaBrowser.Model.Entities attributes.Add(StringHelper.FirstToUpper(fullLanguage ?? Language)); } - if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase)) + if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase) && !string.Equals(Codec, "dts", StringComparison.OrdinalIgnoreCase)) { attributes.Add(AudioCodec.GetFriendlyName(Codec)); } diff --git a/MediaBrowser.Model/IO/IFileSystem.cs b/MediaBrowser.Model/IO/IFileSystem.cs index 7207795b0..786b20e9e 100644 --- a/MediaBrowser.Model/IO/IFileSystem.cs +++ b/MediaBrowser.Model/IO/IFileSystem.cs @@ -200,5 +200,19 @@ namespace MediaBrowser.Model.IO void SetAttributes(string path, bool isHidden, bool readOnly); IEnumerable<FileSystemMetadata> GetDrives(); + + /// <summary> + /// Determines whether the directory exists. + /// </summary> + /// <param name="path">The path.</param> + /// <returns>Whether the path exists.</returns> + bool DirectoryExists(string path); + + /// <summary> + /// Determines whether the file exists. + /// </summary> + /// <param name="path">The path.</param> + /// <returns>Whether the path exists.</returns> + bool FileExists(string path); } } diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 4386f75af..dba3b557d 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -34,7 +34,7 @@ <ItemGroup> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" /> - <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" /> + <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" /> <PackageReference Include="MimeTypes" Version="2.3.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs index 1527ef595..a2835b711 100644 --- a/MediaBrowser.Model/Net/ISocketFactory.cs +++ b/MediaBrowser.Model/Net/ISocketFactory.cs @@ -26,6 +26,6 @@ namespace MediaBrowser.Model.Net /// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param> /// <param name="localPort">The local port to bind to.</param> /// <returns>A <see cref="ISocket"/> implementation.</returns> - ISocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort); + ISocket CreateUdpMulticastSocket(IPAddress ipAddress, int multicastTimeToLive, int localPort); } } diff --git a/MediaBrowser.Model/Querying/ItemSortBy.cs b/MediaBrowser.Model/Querying/ItemSortBy.cs index 0b846bb96..0a28acf37 100644 --- a/MediaBrowser.Model/Querying/ItemSortBy.cs +++ b/MediaBrowser.Model/Querying/ItemSortBy.cs @@ -102,5 +102,9 @@ namespace MediaBrowser.Model.Querying public const string DateLastContentAdded = "DateLastContentAdded"; public const string SeriesDatePlayed = "SeriesDatePlayed"; + + public const string ParentIndexNumber = "ParentIndexNumber"; + + public const string IndexNumber = "IndexNumber"; } } diff --git a/MediaBrowser.Model/Querying/NextUpQuery.cs b/MediaBrowser.Model/Querying/NextUpQuery.cs index 7c65fda1a..133d6a916 100644 --- a/MediaBrowser.Model/Querying/NextUpQuery.cs +++ b/MediaBrowser.Model/Querying/NextUpQuery.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Querying EnableTotalRecordCount = true; DisableFirstEpisode = false; NextUpDateCutoff = DateTime.MinValue; - Rewatching = false; + EnableRewatching = false; } /// <summary> @@ -86,6 +86,6 @@ namespace MediaBrowser.Model.Querying /// <summary> /// Gets or sets a value indicating whether getting rewatching next up list. /// </summary> - public bool Rewatching { get; set; } + public bool EnableRewatching { get; set; } } } diff --git a/MediaBrowser.Model/Session/GeneralCommand.cs b/MediaBrowser.Model/Session/GeneralCommand.cs index 29528c110..757b19b31 100644 --- a/MediaBrowser.Model/Session/GeneralCommand.cs +++ b/MediaBrowser.Model/Session/GeneralCommand.cs @@ -2,20 +2,26 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; -namespace MediaBrowser.Model.Session +namespace MediaBrowser.Model.Session; + +public class GeneralCommand { - public class GeneralCommand + public GeneralCommand() + : this(new Dictionary<string, string>()) + { + } + + [JsonConstructor] + public GeneralCommand(Dictionary<string, string> arguments) { - public GeneralCommand() - { - Arguments = new Dictionary<string, string>(); - } + Arguments = arguments; + } - public GeneralCommandType Name { get; set; } + public GeneralCommandType Name { get; set; } - public Guid ControllingUserId { get; set; } + public Guid ControllingUserId { get; set; } - public Dictionary<string, string> Arguments { get; } - } + public Dictionary<string, string> Arguments { get; } } diff --git a/MediaBrowser.Model/Session/HardwareEncodingType.cs b/MediaBrowser.Model/Session/HardwareEncodingType.cs index 0db5697d3..f5753467a 100644 --- a/MediaBrowser.Model/Session/HardwareEncodingType.cs +++ b/MediaBrowser.Model/Session/HardwareEncodingType.cs @@ -21,28 +21,18 @@ NVENC = 2, /// <summary> - /// OpenMax OMX. + /// Video4Linux2 V4L2. /// </summary> - OMX = 3, - - /// <summary> - /// Exynos V4L2 MFC. - /// </summary> - V4L2M2M = 4, - - /// <summary> - /// MediaCodec Android. - /// </summary> - MediaCodec = 5, + V4L2M2M = 3, /// <summary> /// Video Acceleration API (VAAPI). /// </summary> - VAAPI = 6, + VAAPI = 4, /// <summary> /// Video ToolBox. /// </summary> - VideoToolBox = 7 + VideoToolBox = 5 } } |
