only skip hardcoded wayback snapshots if it has a previous success

ref #325
This commit is contained in:
Collin Barrett 2018-08-25 08:59:21 -05:00
parent 61181e5664
commit 5d6851011b

View file

@ -34,13 +34,13 @@ private async Task<IEnumerable<FilterListViewUrlDto>> GetListsToCapture(int batc
await DbContext
.FilterLists
.Where(l => !l.CantSnapshot &&
!(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) &&
l.Snapshots.Any(s => s.WasSuccessful)) &&
(!l.Snapshots.Any() ||
l.Snapshots
.Select(s => s.CreatedDateUtc)
.OrderByDescending(d => d)
.First() < yesterday &&
!l.ViewUrl
.StartsWith(WaybackService.WaybackMachineUrlPrefix)))
.First() < yesterday))
.OrderBy(l => l.Snapshots.Any())
.ThenBy(l => l.Snapshots
.OrderByDescending(s => s.CreatedDateUtc)