aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Devices
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-01 14:24:15 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-01 14:24:15 -0500
commit37352785acef4db99301c1e88624cf48133ec979 (patch)
tree15638d697cc56a0a774bf261de9814c9034f8e42 /MediaBrowser.Server.Implementations/Devices
parentf14e9b8d3af98f6ffbe243b105f96f46e8cf3b06 (diff)
parentf5ebeddbf5104092ce584486689af6640125054f (diff)
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.Server.Implementations/Devices')
-rw-r--r--MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs b/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
index 43b1e693c..9e4a45253 100644
--- a/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
+++ b/MediaBrowser.Server.Implementations/Devices/DeviceRepository.cs
@@ -25,7 +25,7 @@ namespace MediaBrowser.Server.Implementations.Devices
private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
- private ConcurrentBag<DeviceInfo> _devices;
+ private List<DeviceInfo> _devices;
public DeviceRepository(IApplicationPaths appPaths, IJsonSerializer json, ILogger logger, IFileSystem fileSystem)
{
@@ -93,17 +93,14 @@ namespace MediaBrowser.Server.Implementations.Devices
public IEnumerable<DeviceInfo> GetDevices()
{
- if (_devices == null)
+ lock (_syncLock)
{
- lock (_syncLock)
+ if (_devices == null)
{
- if (_devices == null)
- {
- _devices = new ConcurrentBag<DeviceInfo>(LoadDevices());
- }
+ _devices = LoadDevices().ToList();
}
+ return _devices.ToList();
}
- return _devices.ToList();
}
private IEnumerable<DeviceInfo> LoadDevices()