فهرست منبع

Query User on device creation

Signed-off-by: gnattu <gnattuoc@me.com>
gnattu 1 سال پیش
والد
کامیت
d235378133
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      Jellyfin.Server.Implementations/Devices/DeviceManager.cs

+ 5 - 2
Jellyfin.Server.Implementations/Devices/DeviceManager.cs

@@ -100,10 +100,13 @@ namespace Jellyfin.Server.Implementations.Devices
                 dbContext.Devices.Add(device);
 
                 await dbContext.SaveChangesAsync().ConfigureAwait(false);
+                var newDevice = await dbContext.Devices
+                    .Include(d => d.User)
+                    .FirstOrDefaultAsync(d => d.Id == device.Id)
+                    .ConfigureAwait(false);
+                _devices.Add(device.Id, newDevice!);
             }
 
-            _devices.Add(device.Id, device);
-
             return device;
         }