aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-02-05 01:10:39 +0100
committerGitHub <noreply@github.com>2025-02-04 17:10:39 -0700
commit00b66a06eac4d1331d59a6a9b7de3e99088ebaa9 (patch)
treed97628d72afa37d4e9a314117f697c035485a94c /MediaBrowser.Controller
parent2de04cb07c3b5f02fb5d5d9892541614e990cbe0 (diff)
Enable nullable for AuthorizationInfo (#13485)
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Net/AuthorizationInfo.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Net/AuthorizationInfo.cs b/MediaBrowser.Controller/Net/AuthorizationInfo.cs
index 2452b25ab..e452f2649 100644
--- a/MediaBrowser.Controller/Net/AuthorizationInfo.cs
+++ b/MediaBrowser.Controller/Net/AuthorizationInfo.cs
@@ -1,6 +1,5 @@
-#nullable disable
-
using System;
+using System.Diagnostics.CodeAnalysis;
using Jellyfin.Data.Entities;
namespace MediaBrowser.Controller.Net
@@ -20,31 +19,31 @@ namespace MediaBrowser.Controller.Net
/// Gets or sets the device identifier.
/// </summary>
/// <value>The device identifier.</value>
- public string DeviceId { get; set; }
+ public string? DeviceId { get; set; }
/// <summary>
/// Gets or sets the device.
/// </summary>
/// <value>The device.</value>
- public string Device { get; set; }
+ public string? Device { get; set; }
/// <summary>
/// Gets or sets the client.
/// </summary>
/// <value>The client.</value>
- public string Client { get; set; }
+ public string? Client { get; set; }
/// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
- public string Version { get; set; }
+ public string? Version { get; set; }
/// <summary>
/// Gets or sets the token.
/// </summary>
/// <value>The token.</value>
- public string Token { get; set; }
+ public string? Token { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the authorization is from an api key.
@@ -54,7 +53,7 @@ namespace MediaBrowser.Controller.Net
/// <summary>
/// Gets or sets the user making the request.
/// </summary>
- public User User { get; set; }
+ public User? User { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the token is authenticated.
@@ -62,8 +61,9 @@ namespace MediaBrowser.Controller.Net
public bool IsAuthenticated { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether the request has a token.
+ /// Gets a value indicating whether the request has a token.
/// </summary>
- public bool HasToken { get; set; }
+ [MemberNotNullWhen(true, nameof(Token))]
+ public bool HasToken => !string.IsNullOrWhiteSpace(Token);
}
}