mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
serve discontinuedDate as updatedDate if exists
closes #528 closes #522 related to #427
This commit is contained in:
parent
0f40519a71
commit
a41b547177
1 changed files with 4 additions and 3 deletions
|
|
@ -40,14 +40,15 @@ public FilterListDtoMappingProfile() =>
|
|||
.Select(lt => (int)lt.TagId)))
|
||||
.ForMember(dest => dest.UpdatedDate,
|
||||
opt => opt.MapFrom(src =>
|
||||
src.Snapshots
|
||||
.Count(s => s.WasSuccessful && s.WasUpdated) >= 2
|
||||
src.DiscontinuedDate ??
|
||||
(src.Snapshots
|
||||
.Count(s => s.WasSuccessful && s.WasUpdated) >= 2
|
||||
? src.Snapshots
|
||||
.Where(s => s.WasSuccessful && s.WasUpdated)
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(c => c)
|
||||
.FirstOrDefault()
|
||||
: null))
|
||||
: null)))
|
||||
.ForMember(dest => dest.ViewUrlMirrors,
|
||||
opt => opt.MapFrom(src =>
|
||||
src.ViewUrlMirror1 != null
|
||||
|
|
|
|||
Loading…
Reference in a new issue