aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Devices
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Devices')
-rw-r--r--Emby.Server.Implementations/Devices/DeviceId.cs19
-rw-r--r--Emby.Server.Implementations/Devices/DeviceManager.cs11
2 files changed, 11 insertions, 19 deletions
diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs
index ce6bd67af..4f5950ac7 100644
--- a/Emby.Server.Implementations/Devices/DeviceId.cs
+++ b/Emby.Server.Implementations/Devices/DeviceId.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.IO;
using System.Text;
using MediaBrowser.Common.Configuration;
@@ -15,10 +15,7 @@ namespace Emby.Server.Implementations.Devices
private readonly object _syncLock = new object();
- private string CachePath
- {
- get { return Path.Combine(_appPaths.DataPath, "device.txt"); }
- }
+ private string CachePath => Path.Combine(_appPaths.DataPath, "device.txt");
private string GetCachedId()
{
@@ -70,7 +67,7 @@ namespace Emby.Server.Implementations.Devices
}
}
- private string GetNewId()
+ private static string GetNewId()
{
return Guid.NewGuid().ToString("N");
}
@@ -92,8 +89,9 @@ namespace Emby.Server.Implementations.Devices
public DeviceId(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem)
{
- if (fileSystem == null) {
- throw new ArgumentNullException ("fileSystem");
+ if (fileSystem == null)
+ {
+ throw new ArgumentNullException(nameof(fileSystem));
}
_appPaths = appPaths;
@@ -101,9 +99,6 @@ namespace Emby.Server.Implementations.Devices
_fileSystem = fileSystem;
}
- public string Value
- {
- get { return _id ?? (_id = GetDeviceId()); }
- }
+ public string Value => _id ?? (_id = GetDeviceId());
}
}
diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs
index d95222e26..c72334577 100644
--- a/Emby.Server.Implementations/Devices/DeviceManager.cs
+++ b/Emby.Server.Implementations/Devices/DeviceManager.cs
@@ -1,4 +1,4 @@
-using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Library;
@@ -360,10 +360,7 @@ namespace Emby.Server.Implementations.Devices
return path;
}
- private string DefaultCameraUploadsPath
- {
- get { return Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads"); }
- }
+ private string DefaultCameraUploadsPath => Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads");
public bool CanAccessDevice(User user, string deviceId)
{
@@ -373,7 +370,7 @@ namespace Emby.Server.Implementations.Devices
}
if (string.IsNullOrEmpty(deviceId))
{
- throw new ArgumentNullException("deviceId");
+ throw new ArgumentNullException(nameof(deviceId));
}
if (!CanAccessDevice(user.Policy, deviceId))
@@ -389,7 +386,7 @@ namespace Emby.Server.Implementations.Devices
return true;
}
- private bool CanAccessDevice(UserPolicy policy, string id)
+ private static bool CanAccessDevice(UserPolicy policy, string id)
{
if (policy.EnableAllDevices)
{