From 0c83a99ec1b1dbe9be2d16ddf9abf35a98aff837 Mon Sep 17 00:00:00 2001 From: Wil Stead Date: Thu, 25 Aug 2022 09:22:32 -0400 Subject: [PATCH] Fix what links here paging --- .github/workflows/publish.yml | 2 +- docs/CHANGELOG.md | 4 ++++ src/Models/Article.cs | 8 ++++---- src/WikiExtensions.cs | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 395059a..dd8a5c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,6 @@ name: publish env: - VERSION: '0.8.4-preview' + VERSION: '0.8.5-preview' PRERELEASE: true on: push: diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 48077c0..67a62ee 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.8.5-preview +### Fixed +- What links here paging + ## 0.8.4-preview ### Changed - Modified constructors to add support for group permissions. diff --git a/src/Models/Article.cs b/src/Models/Article.cs index 7661b88..7ffdb5d 100644 --- a/src/Models/Article.cs +++ b/src/Models/Article.cs @@ -240,7 +240,7 @@ public class Article : MarkdownItem public DateTimeOffset Timestamp { get => new(TimestampTicks, TimeSpan.Zero); - set => TimestampTicks = value.ToUniversalTime().Ticks; + set => TimestampTicks = value.UtcTicks; } /// @@ -1747,11 +1747,11 @@ public async Task> GetHistoryAsync( Expression> exp = x => x.WikiId == Id; if (start.HasValue) { - exp = exp.AndAlso(x => x.TimestampTicks >= start.Value.ToUniversalTime().Ticks); + exp = exp.AndAlso(x => x.TimestampTicks >= start.Value.UtcTicks); } if (end.HasValue) { - exp = exp.AndAlso(x => x.TimestampTicks <= end.Value.ToUniversalTime().Ticks); + exp = exp.AndAlso(x => x.TimestampTicks <= end.Value.UtcTicks); } exp = condition is null ? exp : exp.AndAlso(condition); return await dataStore.Query() @@ -2123,7 +2123,7 @@ private protected static ValueTask PostprocessArticleMarkdownAsync( private async Task> GetRevisionsUntilAsync(IDataStore dataStore, DateTimeOffset time) { - var ticks = time.ToUniversalTime().Ticks; + var ticks = time.UtcTicks; var lastMilestone = await dataStore.Query() .Where(x => x.WikiId == Id && x.TimestampTicks <= ticks && x.IsMilestone) .OrderBy(x => x.TimestampTicks, descending: true) diff --git a/src/WikiExtensions.cs b/src/WikiExtensions.cs index 791018f..6fb1d03 100644 --- a/src/WikiExtensions.cs +++ b/src/WikiExtensions.cs @@ -866,7 +866,7 @@ public static async Task> GetSpecialListAsync( return new(new PagedList( articles - .Skip(request.PageNumber * request.PageSize) + .Skip((request.PageNumber - 1) * request.PageSize) .Take(request.PageSize) .Select(x => new LinkInfo( x.Title,