diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
index b74cc90fe..25f5f4f6a 100644
--- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
+++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
@@ -137,10 +137,11 @@ namespace Jellyfin.Server.Implementations.Devices
///
public QueryResult GetDevices(DeviceQuery query)
{
- var devices = _devices.Values.OrderBy(d => d.Id)
+ IEnumerable devices = _devices.Values.OrderBy(d => d.Id)
.Where(device => !query.UserId.HasValue || device.UserId.Equals(query.UserId.Value))
.Where(device => query.DeviceId == null || device.DeviceId == query.DeviceId)
- .Where(device => query.AccessToken == null || device.AccessToken == query.AccessToken);
+ .Where(device => query.AccessToken == null || device.AccessToken == query.AccessToken)
+ .ToList();
var count = devices.Count();
if (query.Skip.HasValue)