diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-09-01 12:31:48 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2025-09-01 12:31:48 -0500 |
| commit | 48c32e0284f7948900b6891cfb3728dbc1819f37 (patch) | |
| tree | 368897707dbdca4140b31ce3d1f2ae33c0911915 /src | |
| parent | 12ac48516cd06d5dad2b4ba99bc38ed60ff000b6 (diff) | |
| download | slskd-48c32e0284f7948900b6891cfb3728dbc1819f37.tar.gz | |
use a list to preserve order
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Telemetry/StatisticsService.cs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/slskd/Telemetry/StatisticsService.cs b/src/slskd/Telemetry/StatisticsService.cs index 26ffaf2b..b5ade6f1 100644 --- a/src/slskd/Telemetry/StatisticsService.cs +++ b/src/slskd/Telemetry/StatisticsService.cs @@ -172,25 +172,24 @@ public class StatisticsService { Direction = direction.ToString(), Limit = limit, + Offset = offset, Start = start, End = end, }; var results = connection.Query<TransferSummaryRow>(sql, param); - foreach (var result in results) + var list = results.Select(row => new TransferSummary { - dict.Add(result.Username, new TransferSummary - { - TotalBytes = result.TotalBytes, - Count = result.Count, - AverageSpeed = result.AverageSpeed, - AverageWait = result.AverageWait, - AverageDuration = result.AverageDuration, - }); - } - - return dict; + Username = row.Username, + TotalBytes = row.TotalBytes, + Count = row.Count, + AverageSpeed = row.AverageSpeed, + AverageWait = row.AverageWait, + AverageDuration = row.AverageDuration, + }).ToList(); + + return list; } private record TransferSummaryRow |
