Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
将作品排行改用新的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed May 12, 2020
1 parent 3c143b1 commit ce3b824
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions PixivFSUWP/Data/Collections/RankingIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,28 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
if (!HasMoreItems) return new LoadMoreItemsResult() { Count = 0 };
LoadMoreItemsResult toret = new LoadMoreItemsResult() { Count = 0 };
JsonObject rankingres = null;
PixivCS.Objects.UserIllusts rankingres = null;
try
{
if (nexturl == "begin")
rankingres = await new PixivCS
.PixivAppAPI(OverAll.GlobalBaseAPI)
.IllustRanking();
.GetIllustRankingAsync();
else
{
Uri next = new Uri(nexturl);
string getparam(string param) => HttpUtility.ParseQueryString(next.Query).Get(param);
rankingres = await new PixivCS
.PixivAppAPI(OverAll.GlobalBaseAPI)
.IllustRanking(Mode: getparam("mode"), Filter: getparam("filter"), Offset: getparam("offset"));
.GetIllustRankingAsync(Mode: getparam("mode"), Filter: getparam("filter"), Offset: getparam("offset"));
}
}
catch
{
return toret;
}
nexturl = rankingres["next_url"].TryGetString();
foreach (var recillust in rankingres["illusts"].GetArray())
nexturl = rankingres.NextUrl?.ToString();
foreach (var recillust in rankingres.Illusts)
{
await Task.Run(() => pause.WaitOne());
if (_emergencyStop)
Expand All @@ -93,7 +93,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
Clear();
return new LoadMoreItemsResult() { Count = 0 };
}
WaterfallItem recommendi = WaterfallItem.FromJsonValue(recillust.GetObject());
WaterfallItem recommendi = WaterfallItem.FromObject(recillust);
var recommendmodel = ViewModels.WaterfallItemViewModel.FromItem(recommendi);
await recommendmodel.LoadImageAsync();
Add(recommendmodel);
Expand Down

0 comments on commit ce3b824

Please sign in to comment.