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 ce3b824 commit d047205
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions PixivFSUWP/Data/Collections/UserIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
if (!HasMoreItems) return new LoadMoreItemsResult() { Count = 0 };
LoadMoreItemsResult toret = new LoadMoreItemsResult() { Count = 0 };
JsonObject illustsres = null;
PixivCS.Objects.UserIllusts illustsres = null;
try
{
if (nexturl == "begin")
illustsres = await new PixivCS
.PixivAppAPI(OverAll.GlobalBaseAPI)
.UserIllusts(userID);
.GetUserIllustsAsync(userID);
else
{
Uri next = new Uri(nexturl);
string getparam(string param) => HttpUtility.ParseQueryString(next.Query).Get(param);
illustsres = await new PixivCS
.PixivAppAPI(OverAll.GlobalBaseAPI)
.UserIllusts(getparam("user_id"), getparam("type"), getparam("filter"), getparam("offset"));
.GetUserIllustsAsync(getparam("user_id"), getparam("type"), getparam("filter"), getparam("offset"));
}
}
catch
{
return toret;
}
nexturl = illustsres["next_url"].TryGetString();
foreach (var recillust in illustsres["illusts"].GetArray())
nexturl = illustsres.NextUrl?.ToString();
foreach (var recillust in illustsres.Illusts)
{
await Task.Run(() => pause.WaitOne());
if (_emergencyStop)
Expand All @@ -99,7 +99,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 d047205

Please sign in to comment.