aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Dlna/SubtitleDeliveryMethod.cs11
-rw-r--r--MediaBrowser.Model/Entities/JsonLowerCaseConverter.cs29
-rw-r--r--MediaBrowser.Model/Entities/VirtualFolderInfo.cs1
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj3
-rw-r--r--MediaBrowser.Model/QuickConnect/QuickConnectResult.cs32
-rw-r--r--MediaBrowser.Model/QuickConnect/QuickConnectState.cs23
6 files changed, 30 insertions, 69 deletions
diff --git a/MediaBrowser.Model/Dlna/SubtitleDeliveryMethod.cs b/MediaBrowser.Model/Dlna/SubtitleDeliveryMethod.cs
index e7fe8d6af..9b39f9e11 100644
--- a/MediaBrowser.Model/Dlna/SubtitleDeliveryMethod.cs
+++ b/MediaBrowser.Model/Dlna/SubtitleDeliveryMethod.cs
@@ -2,25 +2,28 @@
namespace MediaBrowser.Model.Dlna
{
+ /// <summary>
+ /// Delivery method to use during playback of a specific subtitle format.
+ /// </summary>
public enum SubtitleDeliveryMethod
{
/// <summary>
- /// The encode.
+ /// Burn the subtitles in the video track.
/// </summary>
Encode = 0,
/// <summary>
- /// The embed.
+ /// Embed the subtitles in the file or stream.
/// </summary>
Embed = 1,
/// <summary>
- /// The external.
+ /// Serve the subtitles as an external file.
/// </summary>
External = 2,
/// <summary>
- /// The HLS.
+ /// Serve the subtitles as a separate HLS stream.
/// </summary>
Hls = 3
}
diff --git a/MediaBrowser.Model/Entities/JsonLowerCaseConverter.cs b/MediaBrowser.Model/Entities/JsonLowerCaseConverter.cs
deleted file mode 100644
index 7c627f0e3..000000000
--- a/MediaBrowser.Model/Entities/JsonLowerCaseConverter.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-#nullable disable
-// THIS IS A HACK
-// TODO: @bond Move to separate project
-
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace MediaBrowser.Model.Entities
-{
- /// <summary>
- /// Converts an object to a lowercase string.
- /// </summary>
- /// <typeparam name="T">The object type.</typeparam>
- public class JsonLowerCaseConverter<T> : JsonConverter<T>
- {
- /// <inheritdoc />
- public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
- {
- return JsonSerializer.Deserialize<T>(ref reader, options);
- }
-
- /// <inheritdoc />
- public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
- {
- writer.WriteStringValue(value?.ToString().ToLowerInvariant());
- }
- }
-}
diff --git a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
index 8fed392b9..2b2bda12c 100644
--- a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
+++ b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
@@ -3,6 +3,7 @@
using System;
using System.Text.Json.Serialization;
+using Jellyfin.Extensions.Json.Converters;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Model.Entities
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 4db99f0b0..c475d905a 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -50,7 +50,8 @@
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\Jellyfin.Data\Jellyfin.Data.csproj" />
+ <ProjectReference Include="../Jellyfin.Data/Jellyfin.Data.csproj" />
+ <ProjectReference Include="../src/Jellyfin.Extensions/Jellyfin.Extensions.csproj" />
</ItemGroup>
</Project>
diff --git a/MediaBrowser.Model/QuickConnect/QuickConnectResult.cs b/MediaBrowser.Model/QuickConnect/QuickConnectResult.cs
index 0fa40b6a7..d180d2986 100644
--- a/MediaBrowser.Model/QuickConnect/QuickConnectResult.cs
+++ b/MediaBrowser.Model/QuickConnect/QuickConnectResult.cs
@@ -3,38 +3,46 @@ using System;
namespace MediaBrowser.Model.QuickConnect
{
/// <summary>
- /// Stores the result of an incoming quick connect request.
+ /// Stores the state of an quick connect request.
/// </summary>
public class QuickConnectResult
{
/// <summary>
- /// Gets a value indicating whether this request is authorized.
+ /// Initializes a new instance of the <see cref="QuickConnectResult"/> class.
/// </summary>
- public bool Authenticated => !string.IsNullOrEmpty(Authentication);
+ /// <param name="secret">The secret used to query the request state.</param>
+ /// <param name="code">The code used to allow the request.</param>
+ /// <param name="dateAdded">The time when the request was created.</param>
+ public QuickConnectResult(string secret, string code, DateTime dateAdded)
+ {
+ Secret = secret;
+ Code = code;
+ DateAdded = dateAdded;
+ }
/// <summary>
- /// Gets or sets the secret value used to uniquely identify this request. Can be used to retrieve authentication information.
+ /// Gets a value indicating whether this request is authorized.
/// </summary>
- public string? Secret { get; set; }
+ public bool Authenticated => Authentication != null;
/// <summary>
- /// Gets or sets the user facing code used so the user can quickly differentiate this request from others.
+ /// Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information.
/// </summary>
- public string? Code { get; set; }
+ public string Secret { get; }
/// <summary>
- /// Gets or sets the private access token.
+ /// Gets the user facing code used so the user can quickly differentiate this request from others.
/// </summary>
- public string? Authentication { get; set; }
+ public string Code { get; }
/// <summary>
- /// Gets or sets an error message.
+ /// Gets or sets the private access token.
/// </summary>
- public string? Error { get; set; }
+ public Guid? Authentication { get; set; }
/// <summary>
/// Gets or sets the DateTime that this request was created.
/// </summary>
- public DateTime? DateAdded { get; set; }
+ public DateTime DateAdded { get; set; }
}
}
diff --git a/MediaBrowser.Model/QuickConnect/QuickConnectState.cs b/MediaBrowser.Model/QuickConnect/QuickConnectState.cs
deleted file mode 100644
index f1074f25f..000000000
--- a/MediaBrowser.Model/QuickConnect/QuickConnectState.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace MediaBrowser.Model.QuickConnect
-{
- /// <summary>
- /// Quick connect state.
- /// </summary>
- public enum QuickConnectState
- {
- /// <summary>
- /// This feature has not been opted into and is unavailable until the server administrator chooses to opt-in.
- /// </summary>
- Unavailable = 0,
-
- /// <summary>
- /// The feature is enabled for use on the server but is not currently accepting connection requests.
- /// </summary>
- Available = 1,
-
- /// <summary>
- /// The feature is actively accepting connection requests.
- /// </summary>
- Active = 2
- }
-}