diff --git a/VoidCat/Services/VirusScanner/PostgresVirusScanStore.cs b/VoidCat/Services/VirusScanner/PostgresVirusScanStore.cs index 9cb8ff7..eb1dfd3 100644 --- a/VoidCat/Services/VirusScanner/PostgresVirusScanStore.cs +++ b/VoidCat/Services/VirusScanner/PostgresVirusScanStore.cs @@ -18,16 +18,16 @@ public class PostgresVirusScanStore : IVirusScanStore public async ValueTask Get(Guid id) { await using var conn = await _connection.Get(); - return await conn.QuerySingleOrDefaultAsync( - @"select * from ""VirusScanResult"" where ""Id"" = :id", new {id}); + return await conn.QueryFirstOrDefaultAsync( + @"select * from ""VirusScanResult"" where ""Id"" = :id order by ""ScanTime"" desc", new {id}); } /// public async ValueTask GetByFile(Guid id) { await using var conn = await _connection.Get(); - return await conn.QuerySingleOrDefaultAsync( - @"select * from ""VirusScanResult"" where ""File"" = :file", new {file = id}); + return await conn.QueryFirstOrDefaultAsync( + @"select * from ""VirusScanResult"" where ""File"" = :file order by ""ScanTime"" desc", new {file = id}); } ///