Skip to content

Commit

Permalink
Merge pull request #605 from poppastring/archive-bug-fix
Browse files Browse the repository at this point in the history
Fixing archive bug which inadvertently modified the entry cache date.
  • Loading branch information
poppastring authored Nov 28, 2021
2 parents db3a56c + 8ea6345 commit f8ad639
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions source/DasBlog.Web.UI/Controllers/ArchiveController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public IActionResult ArchiveAll()
archiveManager.GetEntriesForYear(new DateTime(year, 1, 1) , languageFilter).OrderByDescending(x => x.CreatedUtc));
}

entries = DateModification(entries);

var alvm = new ArchiveListViewModel();

foreach (var i in entries.ToList().Select(entry => mapper.Map<PostViewModel>(entry)).ToList())
Expand Down Expand Up @@ -127,20 +125,8 @@ private List<MonthViewViewModel> GetMonthsViewModel(DateTime dateTime, bool whol
stopWatch.Stop();
logger.LogInformation(new DasBlog.Services.ActivityLogs.EventDataItem(EventCodes.Site, null, $"ArchiveController (Date: {dateTime.ToLongDateString()}; Year: {wholeYear}) Time elapsed: {stopWatch.Elapsed.TotalMilliseconds}ms"));

entries = DateModification(entries);

DefaultPage(ARCHIVE);
return MonthViewViewModel.Create(dateTime, entries, mapper);
}

private EntryCollection DateModification(EntryCollection coll)
{
foreach (var entry in coll)
{
entry.CreatedUtc = dasBlogSettings.GetDisplayTime(entry.CreatedUtc);
}

return coll;
}
}
}

0 comments on commit f8ad639

Please sign in to comment.