mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 10:43:30 +01:00
Enable nullable for more files
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -17,19 +15,19 @@ namespace Emby.Server.Implementations.Devices
|
||||
private readonly ILogger<DeviceId> _logger;
|
||||
private readonly object _syncLock = new object();
|
||||
|
||||
private string _id;
|
||||
private string? _id;
|
||||
|
||||
public DeviceId(IApplicationPaths appPaths, ILoggerFactory loggerFactory)
|
||||
public DeviceId(IApplicationPaths appPaths, ILogger<DeviceId> logger)
|
||||
{
|
||||
_appPaths = appPaths;
|
||||
_logger = loggerFactory.CreateLogger<DeviceId>();
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public string Value => _id ?? (_id = GetDeviceId());
|
||||
public string Value => _id ??= GetDeviceId();
|
||||
|
||||
private string CachePath => Path.Combine(_appPaths.DataPath, "device.txt");
|
||||
|
||||
private string GetCachedId()
|
||||
private string? GetCachedId()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -65,7 +63,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
{
|
||||
var path = CachePath;
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path) ?? throw new InvalidOperationException("Path can't be a root directory."));
|
||||
|
||||
lock (_syncLock)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user