From f6dce9bc0d5976336208a83ce356a8ccdf8dc2e4 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 8 Jun 2018 15:09:23 -0500 Subject: [PATCH] revert crawled back to updated crawls happen more frequently, this date is the last time a crawl found a change --- src/FilterLists.Services/FilterList/FilterListService.cs | 8 ++++---- src/FilterLists.Services/FilterList/ListDetailsDto.cs | 2 +- src/FilterLists.Services/FilterList/ListSummaryDto.cs | 2 +- src/FilterLists.Web/ClientApp/components/Home.tsx | 6 +++--- src/FilterLists.Web/ClientApp/components/ListDetails.tsx | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/FilterLists.Services/FilterList/FilterListService.cs b/src/FilterLists.Services/FilterList/FilterListService.cs index d460ed4f6..0c2f1c4cb 100644 --- a/src/FilterLists.Services/FilterList/FilterListService.cs +++ b/src/FilterLists.Services/FilterList/FilterListService.cs @@ -25,14 +25,14 @@ public async Task> GetAllSummariesAsync() (summary, snap) => { snap = snap as Data.Entities.Snapshot[] ?? snap.ToArray(); - var crawledDate = snap.Any() ? snap.Single().CreatedDateUtc : (DateTime?) null; + var updatedDate = snap.Any() ? snap.Single().CreatedDateUtc : (DateTime?) null; return new ListSummaryDto { Id = summary.Id, AddedDate = summary.AddedDate, - CrawledDate = crawledDate, Languages = summary.Languages, Name = summary.Name, + UpdatedDate = updatedDate, ViewUrl = summary.ViewUrl }; }); @@ -64,7 +64,7 @@ public async Task GetDetailsAsync(int id) .FirstAsync(x => x.Id == id) .FilterParentListFromMaintainerAdditionalLists(); details.RuleCount = await GetActiveRuleCount(details); - details.CrawledDate = await GetCrawledDate(details); + details.UpdatedDate = await GetUpdatedDate(details); return details; } @@ -76,7 +76,7 @@ private async Task GetActiveRuleCount(ListDetailsDto details) await listSnapshots.SelectMany(sr => sr.RemovedSnapshotRules).CountAsync(); } - private async Task GetCrawledDate(ListDetailsDto details) + private async Task GetUpdatedDate(ListDetailsDto details) { var snapshotDates = DbContext.Snapshots.AsNoTracking() .Where(s => s.FilterListId == details.Id && diff --git a/src/FilterLists.Services/FilterList/ListDetailsDto.cs b/src/FilterLists.Services/FilterList/ListDetailsDto.cs index 4e8a74837..8035892a1 100644 --- a/src/FilterLists.Services/FilterList/ListDetailsDto.cs +++ b/src/FilterLists.Services/FilterList/ListDetailsDto.cs @@ -10,7 +10,6 @@ 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; } @@ -28,6 +27,7 @@ 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 79f264393..c62678743 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 2d8a3cc96..c2c934a7e 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -94,8 +94,8 @@ export class Home extends React.Component, IHomeState> { className: "d-none d-sm-block" }, { - Header: "Crawled", - accessor: "crawledDate", + Header: "Updated", + accessor: "updatedDate", 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 281fa5696..ce8b1efb7 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 CrawledDate(props: any) { +function UpdatedDate(props: any) { return props.date ?
  • -

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

    +

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

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