From 48d2afb8df39be1d9e57efcccac0d622a55bb2b2 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 10 Sep 2025 21:05:10 +0100 Subject: [PATCH] Fix device reports not being detected in device stats. --- Aaru.Server/Components/Pages/Statistics/Devices.razor.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Aaru.Server/Components/Pages/Statistics/Devices.razor.cs b/Aaru.Server/Components/Pages/Statistics/Devices.razor.cs index a78b4a23..2113491f 100644 --- a/Aaru.Server/Components/Pages/Statistics/Devices.razor.cs +++ b/Aaru.Server/Components/Pages/Statistics/Devices.razor.cs @@ -23,16 +23,17 @@ public partial class Devices { await using DbContext ctx = await DbContextFactory.CreateDbContextAsync(); - DevicesList.AddRange(ctx.Devices.OrderBy(static device => device.Manufacturer) + DevicesList.AddRange(ctx.DeviceStats.OrderBy(static device => device.Manufacturer) .ThenBy(static device => device.Model) .ThenBy(static device => device.Revision) - .ThenBy(static device => device.Type) + .ThenBy(static device => device.Bus) .Select(static dev => new DeviceItem { Manufacturer = dev.Manufacturer, Model = dev.Model, Revision = dev.Revision, - Bus = dev.Type.ToString() + Bus = dev.Bus, + ReportId = dev.Report != null && dev.Report.Id != 0 ? dev.Report.Id : 0 })); await base.OnInitializedAsync();