diff --git a/src/FilterLists.Services/FilterList/FilterListService.cs b/src/FilterLists.Services/FilterList/FilterListService.cs index cbb11dc29..2f0550860 100644 --- a/src/FilterLists.Services/FilterList/FilterListService.cs +++ b/src/FilterLists.Services/FilterList/FilterListService.cs @@ -20,8 +20,8 @@ public FilterListService(FilterListsDbContext dbContext) : base(dbContext) public async Task> GetAllSummariesAsync() { var summaries = await GetSummaryDtos(); - var latestUpdatedSnapshots = await GetLatestUpdatedSnapshots(); - return summaries.GroupJoin(latestUpdatedSnapshots, summary => summary.Id, snap => snap.FilterListId, + var latestSnapshots = await GetLatestSnapshots(); + return summaries.GroupJoin(latestSnapshots, summary => summary.Id, snap => snap.FilterListId, (summary, snap) => { var snaps = snap as Data.Entities.Snapshot[] ?? snap.ToArray(); @@ -29,9 +29,9 @@ public async Task> GetAllSummariesAsync() { Id = summary.Id, AddedDate = summary.AddedDate, + CrawledDate = snaps.Any() ? snaps.Single().CreatedDateUtc : (DateTime?) null, Languages = summary.Languages, Name = summary.Name, - UpdatedDate = snaps.Any() ? snaps.Single().CreatedDateUtc : (DateTime?) null, ViewUrl = summary.ViewUrl }; }); @@ -45,7 +45,7 @@ private async Task> GetSummaryDtos() .ToListAsync(); } - private async Task> GetLatestUpdatedSnapshots() + private async Task> GetLatestSnapshots() { return await DbContext.Snapshots.AsNoTracking() .Where(snap => @@ -63,7 +63,7 @@ public async Task GetDetailsAsync(int id) .FirstAsync(x => x.Id == id) .FilterParentListFromMaintainerAdditionalLists(); details.RuleCount = await GetActiveRuleCount(details); - details.UpdatedDate = await GetUpdatedDate(details); + details.CrawledDate = await GetCrawledDate(details); return details; } @@ -75,7 +75,7 @@ private async Task GetActiveRuleCount(ListDetailsDto details) await listSnapshots.SelectMany(sr => sr.RemovedSnapshotRules).CountAsync(); } - private async Task GetUpdatedDate(ListDetailsDto details) + private async Task GetCrawledDate(ListDetailsDto details) { var snapshotDates = DbContext.Snapshots.AsNoTracking() .Where(s => s.FilterListId == details.Id && s.IsCompleted && diff --git a/src/FilterLists.Services/FilterList/ListDetailsDto.cs b/src/FilterLists.Services/FilterList/ListDetailsDto.cs index 8035892a1..4e8a74837 100644 --- a/src/FilterLists.Services/FilterList/ListDetailsDto.cs +++ b/src/FilterLists.Services/FilterList/ListDetailsDto.cs @@ -10,6 +10,7 @@ public class ListDetailsDto public int Id { get; set; } public DateTime AddedDate { get; set; } public string ChatUrl { get; set; } + public DateTime? CrawledDate { get; set; } public string Description { get; set; } public string DescriptionSourceUrl { get; set; } public DateTime? DiscontinuedDate { get; set; } @@ -27,7 +28,6 @@ public class ListDetailsDto public int RuleCount { get; set; } public string SubmissionUrl { get; set; } public ListSyntaxDto Syntax { get; set; } - public DateTime? UpdatedDate { get; set; } public string ViewUrl { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/FilterList/ListSummaryDto.cs b/src/FilterLists.Services/FilterList/ListSummaryDto.cs index c62678743..79f264393 100644 --- a/src/FilterLists.Services/FilterList/ListSummaryDto.cs +++ b/src/FilterLists.Services/FilterList/ListSummaryDto.cs @@ -9,9 +9,9 @@ public class ListSummaryDto { public int Id { get; set; } public DateTime AddedDate { get; set; } + public DateTime? CrawledDate { get; set; } public IEnumerable Languages { get; set; } public string Name { get; set; } - public DateTime? UpdatedDate { get; set; } public string ViewUrl { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index dec916940..2d8a3cc96 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -95,7 +95,7 @@ export class Home extends React.Component, IHomeState> { }, { Header: "Crawled", - accessor: "updatedDate", + accessor: "crawledDate", filterable: true, filterMethod: (filter: any, row: any) => row[filter.id].toUpperCase() .includes(filter.value.toUpperCase()), @@ -166,9 +166,9 @@ export class Home extends React.Component, IHomeState> { interface IListDto { id: number; addedDate: string; + crawledDate: string; name: string; languages: IListLanguageDto[]; - updatedDate: string; viewUrl: string; } diff --git a/src/FilterLists.Web/ClientApp/components/ListDetails.tsx b/src/FilterLists.Web/ClientApp/components/ListDetails.tsx index a7b6007a6..281fa5696 100644 --- a/src/FilterLists.Web/ClientApp/components/ListDetails.tsx +++ b/src/FilterLists.Web/ClientApp/components/ListDetails.tsx @@ -56,7 +56,7 @@ function ListInfo(props: any) { - + @@ -120,10 +120,10 @@ function DiscontinuedDate(props: any) { : null; } -function UpdatedDate(props: any) { +function CrawledDate(props: any) { return props.date ?
  • -

    Last Updated: {moment(props.date).format("MMM D, Y")}

    +

    Last Crawled: {moment(props.date).format("MMM D, Y")}

  • : null; } @@ -312,6 +312,7 @@ function MaintainerUrls(props: any) { interface IFilterListDetailsDto { addedDate: string; chatUrl: string; + crawledDate: string; description: string; descriptionSourceUrl: string; discontinuedDate: string; @@ -328,7 +329,6 @@ interface IFilterListDetailsDto { ruleCount: number; submissionUrl: string; syntax: IListSyntaxDto[]; - updatedDate: string; viewUrl: string; }