simplify ifLastSnapFailed

This commit is contained in:
Collin M. Barrett 2018-09-01 13:18:50 -05:00
parent 83c2f1b20c
commit 8e66be6834

View file

@ -17,12 +17,8 @@ public class SnapshotService : Service
private readonly Expression<Func<Data.Entities.FilterList, bool>> ifLastSnapFailed =
l => l.Snapshots
.OrderByDescending(s => s.CreatedDateUtc)
.FirstOrDefault()
.WasUpdated &&
!l.Snapshots
.OrderByDescending(s => s.CreatedDateUtc)
.FirstOrDefault()
.WasSuccessful;
.Select(s => s.WasUpdated && !s.WasSuccessful)
.FirstOrDefault();
private readonly Expression<Func<Data.Entities.FilterList, bool>> isNotWaybackViewUrlWithSuccessfulSnap =
l => !(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) &&