Update Jellyfin.Server.Implementations/Devices/DeviceManager.cs

Co-authored-by: Bond-009 <bond.009@outlook.com>
This commit is contained in:
gnattu 2024-07-20 20:42:43 +08:00 committed by GitHub
parent 7f0f93eb4a
commit 1739962f52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,10 +133,11 @@ namespace Jellyfin.Server.Implementations.Devices
/// <inheritdoc />
public QueryResult<Device> GetDevices(DeviceQuery query)
{
IEnumerable<Device> devices = _devices.Values.OrderBy(d => d.Id)
IEnumerable<Device> 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();