Skip to content

Commit

Permalink
Fix what links here paging
Browse files Browse the repository at this point in the history
  • Loading branch information
WilStead committed Aug 25, 2022
1 parent a386241 commit 0c83a99
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: publish
env:
VERSION: '0.8.4-preview'
VERSION: '0.8.5-preview'
PRERELEASE: true
on:
push:
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/Models/Article.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/// <summary>
Expand Down Expand Up @@ -1747,11 +1747,11 @@ public async Task<IPagedList<Revision>> GetHistoryAsync(
Expression<Func<Revision, bool>> 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<Revision>()
Expand Down Expand Up @@ -2123,7 +2123,7 @@ private protected static ValueTask<string> PostprocessArticleMarkdownAsync(

private async Task<IReadOnlyList<Revision>> GetRevisionsUntilAsync(IDataStore dataStore, DateTimeOffset time)
{
var ticks = time.ToUniversalTime().Ticks;
var ticks = time.UtcTicks;
var lastMilestone = await dataStore.Query<Revision>()
.Where(x => x.WikiId == Id && x.TimestampTicks <= ticks && x.IsMilestone)
.OrderBy(x => x.TimestampTicks, descending: true)
Expand Down
2 changes: 1 addition & 1 deletion src/WikiExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ public static async Task<PagedListDTO<LinkInfo>> GetSpecialListAsync(

return new(new PagedList<LinkInfo>(
articles
.Skip(request.PageNumber * request.PageSize)
.Skip((request.PageNumber - 1) * request.PageSize)
.Take(request.PageSize)
.Select(x => new LinkInfo(
x.Title,
Expand Down

0 comments on commit 0c83a99

Please sign in to comment.