private async Task SearchIllust() { var illusts = await _queryCacheService.RunAsync(_pixivClient.Search.IllustAsync, duration => _optionParam.Duration.ToParamString(), search_target => _optionParam.Target.ToParamString(), sort => _optionParam.Sort.ToParamString(), word => _query, filter => "for_ios", offset => _offset); illusts?.IllustList.Where(w => w.TotalBookmarks >= _optionParam.BookmarkCount) .Where(w => w.TotalView >= _optionParam.ViewCount) .Where(w => w.TotalComments >= _optionParam.CommentCount) .Where(w => w.PageCount >= _optionParam.CommentCount) .Where(w => (w.Height >= _optionParam.Height) && (w.Width >= _optionParam.Width)) .Where(w => string.IsNullOrWhiteSpace(_optionParam.Tool) || w.Tools.Any(v => v == _optionParam.Tool)) .ForEach(w => ResultIllusts.Add(w)); if (string.IsNullOrWhiteSpace(illusts?.NextUrl)) { HasMoreItems = false; } else { _offset = UrlParameter.ParseQuery(illusts.NextUrl)["offset"]; } }
private async Task QueryIllust() { var bookmarksApi = _pixivClient.User.Bookmarks; var illusts = await _queryCacheService.RunAsync(bookmarksApi.IllustAsync, user_id => _optionParam.UserId, filter => "for_ios", restrict => _optionParam.Restrict.ToParamString(), max_bookmark_id => _maxBookmarkId, tag => _optionParam.Tag ?? ""); illusts?.IllustList.ForEach(w => ResultIllusts.Add(w)); if (string.IsNullOrWhiteSpace(illusts?.NextUrl)) { HasMoreItems = false; } else { _maxBookmarkId = UrlParameter.ParseQuery(illusts.NextUrl)["max_bookmark_id"]; } }