public override async ValueTask <bool> MoveNextAsync() { if (entity == null) { if (await TryGetResponse($"https://app-api.pixiv.net/v1/user/following?user_id={userId}&restrict=public") is (true, var model)) { entity = model; UpdateEnumerator(); } else { throw new QueryNotRespondingException(); } Enumerable.ReportRequestedPages(); }
public async IAsyncEnumerable<User> MoveNextAsync() { var url = $"https://app-api.pixiv.net/v1/user/following?user_id={uid}&restrict=public"; context = (await HttpClientFactory.AppApiHttpClient.GetStringAsync(context == null ? url : context.NextUrl)).FromJson<FollowingResponse>(); foreach (var preview in context.UserPreviews.Where(u => u != null)) { var usr = new User { Thumbnails = preview.Illusts.Select(i => i.ImageUrls.SquareMedium).ToArray(), Id = preview.User.Id.ToString(), Name = preview.User.Name, Avatar = preview.User.ProfileImageUrls.Medium }; yield return usr; } }