assume lists haven't been updated since being discontinued

ref #351
This commit is contained in:
Collin M. Barrett 2018-08-31 13:32:35 -05:00
parent 03eb87597c
commit 67fc31b620
2 changed files with 8 additions and 6 deletions

View file

@ -25,14 +25,15 @@ public ListDetailsDtoMappingProfile() =>
: 0))
.ForMember(d => d.UpdatedDate,
o => o.MapFrom(l =>
l.Snapshots
.Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2
l.DiscontinuedDate ??
(l.Snapshots
.Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2
? l.Snapshots
.Where(s => s.WasSuccessful && s.Md5Checksum != null)
.Select(s => s.CreatedDateUtc)
.OrderByDescending(c => c)
.FirstOrDefault()
: null))
: null)))
.ForMember(d => d.ViewUrl,
o => o.MapFrom(l =>
l.Snapshots

View file

@ -14,14 +14,15 @@ public ListSummaryDtoMappingProfile() =>
.ForMember(d => d.Tags, o => o.MapFrom(l => l.FilterListTags.Select(m => m.Tag)))
.ForMember(d => d.UpdatedDate,
o => o.MapFrom(l =>
l.Snapshots
.Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2
l.DiscontinuedDate ??
(l.Snapshots
.Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2
? l.Snapshots
.Where(s => s.WasSuccessful && s.Md5Checksum != null)
.Select(s => s.CreatedDateUtc)
.OrderByDescending(c => c)
.FirstOrDefault()
: null))
: null)))
.ForMember(d => d.ViewUrl,
o => o.MapFrom(l =>
l.Snapshots