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 59fb8c4 commit 3c143b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions PixivFSUWP/Data/Collections/FollowingIllustsCollection.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 followingres = null;
PixivCS.Objects.UserIllusts followingres = null;
try
{
if (nexturl == "begin")
followingres = await new PixivCS
.PixivAppAPI(OverAll.GlobalBaseAPI)
.IllustFollow();
.GetIllustFollowAsync();
else
{
Uri next = new Uri(nexturl);
string getparam(string param) => HttpUtility.ParseQueryString(next.Query).Get(param);
followingres = await new PixivCS
.PixivAppAPI(OverAll.GlobalBaseAPI)
.IllustFollow(getparam("restrict"), getparam("offset"));
.GetIllustFollowAsync(getparam("restrict"), getparam("offset"));
}
}
catch
{
return toret;
}
nexturl = followingres["next_url"].TryGetString();
foreach (var recillust in followingres["illusts"].GetArray())
nexturl = followingres.NextUrl?.ToString();
foreach (var recillust in followingres.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 3c143b1

Please sign in to comment.