mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
don't provide updated date if explicit discontinued date
This commit is contained in:
parent
fa568daf2a
commit
92a3a61a4d
1 changed files with 10 additions and 8 deletions
|
|
@ -48,15 +48,17 @@ await DbContext.Snapshots.Where(s => s.FilterListId == details.Id && s.IsComplet
|
|||
.CountAsync();
|
||||
}
|
||||
|
||||
private async Task<DateTime> GetUpdatedDate(ListDetailsDto details)
|
||||
private async Task<DateTime?> GetUpdatedDate(ListDetailsDto details)
|
||||
{
|
||||
return await DbContext.Snapshots.Where(s => s.FilterListId == details.Id && s.IsCompleted)
|
||||
.Include(s => s.AddedSnapshotRules)
|
||||
.Include(s => s.RemovedSnapshotRules)
|
||||
.Where(s => s.AddedSnapshotRules.Count > 0 || s.RemovedSnapshotRules.Count > 0)
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(s => s.Date)
|
||||
.FirstAsync();
|
||||
return details.DiscontinuedDate != null
|
||||
? (DateTime?) null
|
||||
: await DbContext.Snapshots.Where(s => s.FilterListId == details.Id && s.IsCompleted)
|
||||
.Include(s => s.AddedSnapshotRules)
|
||||
.Include(s => s.RemovedSnapshotRules)
|
||||
.Where(s => s.AddedSnapshotRules.Count > 0 || s.RemovedSnapshotRules.Count > 0)
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(s => s.Date)
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue