From 1739962f529805fdd1d72d0bd7b09048e00dfc07 Mon Sep 17 00:00:00 2001 From: gnattu Date: Sat, 20 Jul 2024 20:42:43 +0800 Subject: [PATCH] Update Jellyfin.Server.Implementations/Devices/DeviceManager.cs Co-authored-by: Bond-009 --- Jellyfin.Server.Implementations/Devices/DeviceManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs index 5d5963eddd..d7a46e2d54 100644 --- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs +++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs @@ -133,10 +133,11 @@ namespace Jellyfin.Server.Implementations.Devices /// public QueryResult GetDevices(DeviceQuery query) { - IEnumerable devices = _devices.Values.OrderBy(d => d.Id) + IEnumerable devices = _devices.Values .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) + .OrderBy(d => d.Id) .ToList(); var count = devices.Count();