Skip to content

Commit

Permalink
Fix duplicate logs when skipping before filtering (#9275)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSmugleaf authored Jun 29, 2022
1 parent fedd631 commit 000e7f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Content.Server/Administration/Logs/AdminLogManager.Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ private bool TrySearchCache(LogFilter? filter, [NotNullWhen(true)] out List<Shar
$"Unknown {nameof(DateOrder)} value {filter.DateOrder}")
};

if (filter.LogsSent != 0)
{
query = query.Skip(filter.LogsSent);
}

if (filter.Search != null)
{
query = query.Where(log => log.Message.Contains(filter.Search, StringComparison.OrdinalIgnoreCase));
Expand Down Expand Up @@ -137,6 +132,11 @@ private bool TrySearchCache(LogFilter? filter, [NotNullWhen(true)] out List<Shar
query = query.Where(log => filter.AllPlayers.All(filterPlayer => log.Players.Contains(filterPlayer)));
}

if (filter.LogsSent != 0)
{
query = query.Skip(filter.LogsSent);
}

if (filter.Limit != null)
{
query = query.Take(filter.Limit.Value);
Expand Down

0 comments on commit 000e7f6

Please sign in to comment.