Skip to content

Commit

Permalink
Merge pull request #6 from squashili/master
Browse files Browse the repository at this point in the history
Added basic paging (next/previous page)
  • Loading branch information
ImoutoChan authored Jan 29, 2025
2 parents a74b657 + a677c9d commit 7a2c7f6
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Imouto.BooruParser/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public interface IBooruApiLoader
Task<Post?> GetPostByMd5Async(string md5);

Task<SearchResult> SearchAsync(string tags);
Task<SearchResult> GetNextPageAsync(SearchResult results);
Task<SearchResult> GetPreviousPageAsync(SearchResult results);

Task<SearchResult> GetPopularPostsAsync(PopularType type);

Expand All @@ -58,7 +60,7 @@ public interface IBooruApiAccessor
/// <param name="Page">For danbooru: b{lowest-history-id-on-current-page}</param>
public record SearchToken(string Page);

public record SearchResult(IReadOnlyCollection<PostPreview> Results);
public record SearchResult(IReadOnlyCollection<PostPreview> Results, string SearchTags, int PageNumber);

public record HistorySearchResult<T>(
IReadOnlyCollection<T> Results,
Expand Down
35 changes: 33 additions & 2 deletions Imouto.BooruParser/Implementations/Danbooru/DanbooruApiLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,44 @@ public async Task<SearchResult> SearchAsync(string tags)
{
var posts = await _flurlClient.Request("posts.json")
.SetQueryParam("tags", tags)
.SetQueryParam("page", 1)
.SetQueryParam("only", "id,md5,tag_string,is_banned,is_deleted")
.WithUserAgent(_botUserAgent)
.GetJsonAsync<IReadOnlyCollection<DanbooruPostPreview>>();

return new SearchResult(posts
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.TagString, x.IsBanned, x.IsDeleted))
.ToList());
.ToList(),tags, 1);
}
public async Task<SearchResult> GetNextPageAsync(SearchResult results)
{
var posts = await _flurlClient.Request("posts.json")
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("page", results.PageNumber + 1)
.SetQueryParam("only", "id,md5,tag_string,is_banned,is_deleted")
.WithUserAgent(_botUserAgent)
.GetJsonAsync<IReadOnlyCollection<DanbooruPostPreview>>();

return new SearchResult(posts
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.TagString, x.IsBanned, x.IsDeleted))
.ToList(), results.SearchTags, results.PageNumber + 1);
}

public async Task<SearchResult> GetPreviousPageAsync(SearchResult results)
{
if (results.PageNumber <= 1)
throw new ArgumentOutOfRangeException("PageNumber", results.PageNumber, null);

var posts = await _flurlClient.Request("posts.json")
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("page", results.PageNumber - 1)
.SetQueryParam("only", "id,md5,tag_string,is_banned,is_deleted")
.WithUserAgent(_botUserAgent)
.GetJsonAsync<IReadOnlyCollection<DanbooruPostPreview>>();

return new SearchResult(posts
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.TagString, x.IsBanned, x.IsDeleted))
.ToList(), results.SearchTags, results.PageNumber + 1);
}

public async Task<SearchResult> GetPopularPostsAsync(PopularType type)
Expand All @@ -111,7 +142,7 @@ public async Task<SearchResult> GetPopularPostsAsync(PopularType type)

return new SearchResult(posts
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.TagString, x.IsBanned, x.IsDeleted))
.ToList());
.ToList(),"popular",1);
}

public async Task<HistorySearchResult<TagHistoryEntry>> GetTagHistoryPageAsync(
Expand Down
61 changes: 56 additions & 5 deletions Imouto.BooruParser/Implementations/Gelbooru/GelbooruApiLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Flurl.Http.Configuration;
using HtmlAgilityPack;
using Imouto.BooruParser.Extensions;
using Imouto.BooruParser.Implementations.Danbooru;
using Microsoft.Extensions.Options;

namespace Imouto.BooruParser.Implementations.Gelbooru;
Expand Down Expand Up @@ -81,15 +82,65 @@ public async Task<SearchResult> SearchAsync(string tags)
{
// https://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&limit=20&tags=1girl
var postJson = await _flurlClient.Request("index.php")
.SetQueryParams(new
{
page = "dapi", s = "post", q = "index", json = 1, limit = 20, tags = tags
})
.SetQueryParam("page", "dapi")
.SetQueryParam("s", "post")
.SetQueryParam("q", "index")
.SetQueryParam("json", 1)
.SetQueryParam("limit", 20)
.SetQueryParam("tags", tags)
.SetQueryParam("pid", 0)
.GetJsonAsync<GelbooruPostPage>();

return new SearchResult(postJson.Posts?
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.Tags, false, false))
.ToArray() ?? Array.Empty<PostPreview>());
.ToArray() ?? Array.Empty<PostPreview>(), tags, 0);
}

public async Task<SearchResult> GetNextPageAsync(SearchResult results)
{
var postJson = await _flurlClient.Request("index.php")
.SetQueryParam("page", "dapi")
.SetQueryParam("s", "post")
.SetQueryParam("q", "index")
.SetQueryParam("json", 1)
.SetQueryParam("limit", 20)
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("pid", results.PageNumber + 1)
.GetJsonAsync<GelbooruPostPage>();

return new SearchResult(postJson.Posts?
.Select(x => new PostPreview(
x.Id.ToString(),
x.Md5,
x.Tags,
false,
false))
.ToArray() ?? Array.Empty<PostPreview>(), results.SearchTags, results.PageNumber + 1);
}

public async Task<SearchResult> GetPreviousPageAsync(SearchResult results)
{
if (results.PageNumber <= 0)
throw new ArgumentOutOfRangeException("PageNumber", results.PageNumber, null);

var postJson = await _flurlClient.Request("index.php")
.SetQueryParam("page", "dapi")
.SetQueryParam("s", "post")
.SetQueryParam("q", "index")
.SetQueryParam("json", 1)
.SetQueryParam("limit", 20)
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("pid", results.PageNumber - 1)
.GetJsonAsync<GelbooruPostPage>();

return new SearchResult(postJson.Posts?
.Select(x => new PostPreview(
x.Id.ToString(),
x.Md5,
x.Tags,
false,
false))
.ToArray() ?? Array.Empty<PostPreview>(), results.SearchTags, results.PageNumber - 1);
}

public Task<SearchResult> GetPopularPostsAsync(PopularType type)
Expand Down
60 changes: 55 additions & 5 deletions Imouto.BooruParser/Implementations/Rule34/Rule34ApiLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Flurl.Http.Configuration;
using HtmlAgilityPack;
using Imouto.BooruParser.Extensions;
using Imouto.BooruParser.Implementations.Gelbooru;
using Microsoft.Extensions.Options;

namespace Imouto.BooruParser.Implementations.Rule34;
Expand Down Expand Up @@ -107,17 +108,66 @@ public async Task<SearchResult> SearchAsync(string tags)
{
// https://api.rule34.xxx/index.php?page=dapi&s=post&q=index&json=1&tags=1girl
var postJson = await _flurlJsonClient.Request("index.php")
.SetQueryParams(new
{
page = "dapi", s = "post", q = "index", json = 1, limit = 20, tags = tags
})
.SetQueryParam("page", "dapi")
.SetQueryParam("s", "post")
.SetQueryParam("q", "index")
.SetQueryParam("json", 1)
.SetQueryParam("limit", 20)
.SetQueryParam("tags", tags)
.SetQueryParam("pid", 0)
.GetJsonAsync<Rule34Post[]>();

return new SearchResult(postJson?
.Select(x => new PostPreview(x.Id.ToString(), x.Hash, x.Tags, false, false))
.ToArray() ?? Array.Empty<PostPreview>());
.ToArray() ?? Array.Empty<PostPreview>(), tags, 0);
}

public async Task<SearchResult> GetNextPageAsync(SearchResult results)
{
var postJson = await _flurlJsonClient.Request("index.php")
.SetQueryParam("page", "dapi")
.SetQueryParam("s", "post")
.SetQueryParam("q", "index")
.SetQueryParam("json", 1)
.SetQueryParam("limit", 20)
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("pid", results.PageNumber + 1)
.GetJsonAsync<Rule34Post[]>();

return new SearchResult(postJson?
.Select(x => new PostPreview(
x.Id.ToString(),
x.Hash,
x.Tags,
false,
false))
.ToArray() ?? Array.Empty<PostPreview>(), results.SearchTags, results.PageNumber + 1);
}

public async Task<SearchResult> GetPreviousPageAsync(SearchResult results)
{
if (results.PageNumber <= 0)
throw new ArgumentOutOfRangeException("PageNumber", results.PageNumber, null);

var postJson = await _flurlJsonClient.Request("index.php")
.SetQueryParam("page", "dapi")
.SetQueryParam("s", "post")
.SetQueryParam("q", "index")
.SetQueryParam("json", 1)
.SetQueryParam("limit", 20)
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("pid", results.PageNumber - 1)
.GetJsonAsync<Rule34Post[]>();

return new SearchResult(postJson?
.Select(x => new PostPreview(
x.Id.ToString(),
x.Hash,
x.Tags,
false,
false))
.ToArray() ?? Array.Empty<PostPreview>(), results.SearchTags, results.PageNumber - 1);
}
public Task<SearchResult> GetPopularPostsAsync(PopularType type)
=> throw new NotSupportedException("Rule34 does not support popularity charts");

Expand Down
40 changes: 39 additions & 1 deletion Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public async Task<SearchResult> SearchAsync(string tags)
{
var posts = await _flurlClient.Request("posts")

Check failure on line 122 in Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs

View workflow job for this annotation

GitHub Actions / Tests

Imouto.BooruParser.Tests.Loaders.SankakuLoaderTests+GetPopularPostsAsyncMethod ► ShouldLoadPopularForDay

Failed test found in: TestResults/_fv-az531-216_2025-01-29_22_46_33.trx Error: Flurl.Http.FlurlHttpException : Call failed. An error occurred while sending the request: GET https://capi-v2.sankakucomplex.com/posts?tags=date%3A2025-01-28..2025-01-29%20order%3Aquality&page=1 ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.HttpIOException : The response ended prematurely. (ResponseEnded)
Raw output
Flurl.Http.FlurlHttpException : Call failed. An error occurred while sending the request: GET https://capi-v2.sankakucomplex.com/posts?tags=date%3A2025-01-28..2025-01-29%20order%3Aquality&page=1
---- System.Net.Http.HttpRequestException : An error occurred while sending the request.
-------- System.Net.Http.HttpIOException : The response ended prematurely. (ResponseEnded)
   at Flurl.Http.FlurlClient.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Flurl.Http.ResponseExtensions.ReceiveJson[T](Task`1 response)
   at Imouto.BooruParser.Implementations.Sankaku.SankakuApiLoader.SearchAsync(String tags) in /home/runner/work/ImoutoBooruParser/ImoutoBooruParser/Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs:line 122
   at Imouto.BooruParser.Tests.Loaders.SankakuLoaderTests.GetPopularPostsAsyncMethod.ShouldLoadPopularForDay() in /home/runner/work/ImoutoBooruParser/ImoutoBooruParser/Imouto.BooruParser.Tests/Loaders/SankakuLoaderTests.cs:line 324
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)

Check failure on line 122 in Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs

View workflow job for this annotation

GitHub Actions / Tests

Imouto.BooruParser.Tests.Loaders.SankakuLoaderTests+GetPopularPostsAsyncMethod ► ShouldLoadPopularForMonth

Failed test found in: TestResults/_fv-az531-216_2025-01-29_22_46_33.trx Error: Flurl.Http.FlurlHttpException : Call failed. An error occurred while sending the request: GET https://capi-v2.sankakucomplex.com/posts?tags=date%3A2024-12-29..2025-01-29%20order%3Aquality&page=1 ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.HttpIOException : The response ended prematurely. (ResponseEnded)
Raw output
Flurl.Http.FlurlHttpException : Call failed. An error occurred while sending the request: GET https://capi-v2.sankakucomplex.com/posts?tags=date%3A2024-12-29..2025-01-29%20order%3Aquality&page=1
---- System.Net.Http.HttpRequestException : An error occurred while sending the request.
-------- System.Net.Http.HttpIOException : The response ended prematurely. (ResponseEnded)
   at Flurl.Http.FlurlClient.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Flurl.Http.ResponseExtensions.ReceiveJson[T](Task`1 response)
   at Imouto.BooruParser.Implementations.Sankaku.SankakuApiLoader.SearchAsync(String tags) in /home/runner/work/ImoutoBooruParser/ImoutoBooruParser/Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs:line 122
   at Imouto.BooruParser.Tests.Loaders.SankakuLoaderTests.GetPopularPostsAsyncMethod.ShouldLoadPopularForMonth() in /home/runner/work/ImoutoBooruParser/ImoutoBooruParser/Imouto.BooruParser.Tests/Loaders/SankakuLoaderTests.cs:line 344
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)

Check failure on line 122 in Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs

View workflow job for this annotation

GitHub Actions / Tests

Imouto.BooruParser.Tests.Loaders.SankakuLoaderTests+GetPopularPostsAsyncMethod ► ShouldLoadPopularForWeek

Failed test found in: TestResults/_fv-az531-216_2025-01-29_22_46_33.trx Error: Flurl.Http.FlurlHttpException : Call failed. An error occurred while sending the request: GET https://capi-v2.sankakucomplex.com/posts?tags=date%3A2025-01-22..2025-01-29%20order%3Aquality&page=1 ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.HttpIOException : The response ended prematurely. (ResponseEnded)
Raw output
Flurl.Http.FlurlHttpException : Call failed. An error occurred while sending the request: GET https://capi-v2.sankakucomplex.com/posts?tags=date%3A2025-01-22..2025-01-29%20order%3Aquality&page=1
---- System.Net.Http.HttpRequestException : An error occurred while sending the request.
-------- System.Net.Http.HttpIOException : The response ended prematurely. (ResponseEnded)
   at Flurl.Http.FlurlClient.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Flurl.Http.ResponseExtensions.ReceiveJson[T](Task`1 response)
   at Imouto.BooruParser.Implementations.Sankaku.SankakuApiLoader.SearchAsync(String tags) in /home/runner/work/ImoutoBooruParser/ImoutoBooruParser/Imouto.BooruParser/Implementations/Sankaku/SankakuApiLoader.cs:line 122
   at Imouto.BooruParser.Tests.Loaders.SankakuLoaderTests.GetPopularPostsAsyncMethod.ShouldLoadPopularForWeek() in /home/runner/work/ImoutoBooruParser/ImoutoBooruParser/Imouto.BooruParser.Tests/Loaders/SankakuLoaderTests.cs:line 334
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Flurl.Http.FlurlClient.SendAsync(IFlurlRequest request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
.SetQueryParam("tags", tags)
.SetQueryParam("page", 1)
.GetJsonAsync<IReadOnlyCollection<SankakuPost>>();

return new SearchResult(posts
Expand All @@ -130,7 +131,44 @@ public async Task<SearchResult> SearchAsync(string tags)
string.Join(" ", x.Tags.Select(y => y.TagName)),
false,
false))
.ToList());
.ToList(), tags, 1);
}

public async Task<SearchResult> GetNextPageAsync(SearchResult results)
{
var posts = await _flurlClient.Request("posts")
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("page", results.PageNumber+1)
.GetJsonAsync<IReadOnlyCollection<SankakuPost>>();

return new SearchResult(posts
.Select(x => new PostPreview(
x.Id,
x.Md5,
string.Join(" ", x.Tags.Select(y => y.TagName)),
false,
false))
.ToList(), results.SearchTags, results.PageNumber+1);
}

public async Task<SearchResult> GetPreviousPageAsync(SearchResult results)
{
if (results.PageNumber <= 1)
throw new ArgumentOutOfRangeException("PageNumber",results.PageNumber,null);

var posts = await _flurlClient.Request("posts")
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("page", results.PageNumber - 1)
.GetJsonAsync<IReadOnlyCollection<SankakuPost>>();

return new SearchResult(posts
.Select(x => new PostPreview(
x.Id,
x.Md5,
string.Join(" ", x.Tags.Select(y => y.TagName)),
false,
false))
.ToList(), results.SearchTags, results.PageNumber - 1);
}

public Task<SearchResult> GetPopularPostsAsync(PopularType type)
Expand Down
46 changes: 44 additions & 2 deletions Imouto.BooruParser/Implementations/Yandere/YandereApiLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Flurl.Http.Configuration;
using HtmlAgilityPack;
using Imouto.BooruParser.Extensions;
using Imouto.BooruParser.Implementations.Rule34;
using Microsoft.Extensions.Options;

namespace Imouto.BooruParser.Implementations.Yandere;
Expand Down Expand Up @@ -75,8 +76,48 @@ public async Task<SearchResult> SearchAsync(string tags)

return new SearchResult(posts
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.Tags, false, false))
.ToList());
.ToList(), tags, 1);
}
public async Task<SearchResult> GetNextPageAsync(SearchResult results)
{

var posts = await _flurlClient.Request("post.json")
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("page", results.PageNumber + 1)
.GetJsonAsync<IReadOnlyCollection<YanderePost>>();

return new SearchResult(posts
.Select(x => new PostPreview(
x.Id.ToString(),
x.Md5,
x.Tags,
false,
false))
.ToList(), results.SearchTags, results.PageNumber + 1);

}
public async Task<SearchResult> GetPreviousPageAsync(SearchResult results)
{
if (results.PageNumber <= 1)
throw new ArgumentOutOfRangeException("PageNumber", results.PageNumber, null);


var posts = await _flurlClient.Request("post.json")
.SetQueryParam("tags", results.SearchTags)
.SetQueryParam("page", results.PageNumber - 1)
.GetJsonAsync<IReadOnlyCollection<YanderePost>>();

return new SearchResult(posts
.Select(x => new PostPreview(
x.Id.ToString(),
x.Md5,
x.Tags,
false,
false))
.ToList(), results.SearchTags, results.PageNumber - 1);

}


public async Task<SearchResult> GetPopularPostsAsync(PopularType type)
{
Expand All @@ -95,9 +136,10 @@ public async Task<SearchResult> GetPopularPostsAsync(PopularType type)

return new SearchResult(posts
.Select(x => new PostPreview(x.Id.ToString(), x.Md5, x.Tags, false, false))
.ToList());
.ToList(), "popular", 1);
}


public async Task<HistorySearchResult<TagHistoryEntry>> GetTagHistoryPageAsync(
SearchToken? token,
int limit = 100,
Expand Down

0 comments on commit 7a2c7f6

Please sign in to comment.