diff options
| author | Patrick Barron <barronpm@gmail.com> | 2021-10-02 14:06:00 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2021-10-03 21:41:22 -0400 |
| commit | 6cc69b80b6cf9310e9503c82c0c22bfc9120ec9e (patch) | |
| tree | a5d6a318f3555c6878b18c34bb37e14553a2b2da | |
| parent | 80223c548c43acabf07a581393ea45e7f165eeef (diff) | |
Fix warnings in DeviceId
| -rw-r--r-- | Emby.Server.Implementations/Devices/DeviceId.cs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 3d15b3e76..0cfced8be 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -15,9 +15,18 @@ namespace Emby.Server.Implementations.Devices { private readonly IApplicationPaths _appPaths; private readonly ILogger<DeviceId> _logger; - private readonly object _syncLock = new object(); + private string _id; + + public DeviceId(IApplicationPaths appPaths, ILoggerFactory loggerFactory) + { + _appPaths = appPaths; + _logger = loggerFactory.CreateLogger<DeviceId>(); + } + + public string Value => _id ?? (_id = GetDeviceId()); + private string CachePath => Path.Combine(_appPaths.DataPath, "device.txt"); private string GetCachedId() @@ -86,15 +95,5 @@ namespace Emby.Server.Implementations.Devices return id; } - - private string _id; - - public DeviceId(IApplicationPaths appPaths, ILoggerFactory loggerFactory) - { - _appPaths = appPaths; - _logger = loggerFactory.CreateLogger<DeviceId>(); - } - - public string Value => _id ?? (_id = GetDeviceId()); } } |
