func SearchOptionContentRating(rating ContentRating) SearchOption {
	return func(so *SearchOptions) {
		so.ContentRating = rating
	}
}
SearchOptionContentRating filter result by content rating
package artwork
import (
	"context"
	"net/url"
	"strconv"
	"github.com/NateScarlet/pixiv/pkg/client"
	"github.com/NateScarlet/pixiv/pkg/image"
	"github.com/NateScarlet/pixiv/pkg/user"
	"github.com/tidwall/gjson"
)
type SearchResult struct {
	JSON gjson.Result
}
func (r SearchResult) ForEach(iterator func(key gjson.Result, value gjson.Result) bool) {
	r.JSON.Get("illustManga.data").ForEach(func(key gjson.Result, value gjson.Result) bool {
		if value.Get("isAdContainer").Bool() {
			return true
		}
		return iterator(key, value)
	})
}
func (r SearchResult) Artworks() []Artwork {
	ret := []Artwork{}
	r.ForEach(func(key, value gjson.Result) bool {
		a := Artwork{
			ID:    value.Get("id").String(),
			Title: value.Get("title").String(),
			Type:  value.Get("illustType").String(),
			Author: user.User{
				ID:   value.Get("userId").String(),
				Name: value.Get("userName").String(),
				Avatar: image.URLs{
					Mini: value.Get("profileImageUrl").String(),
				},
			},
			Description: value.Get("description").String(),
			Image: image.URLs{
				Thumb: value.Get("url").String(),
			},
			PageCount: value.Get("pageCount").Int(),
		}
		tagsData := value.Get("tags").Array()
		tags := make([]string, len(tagsData))
		for index, v := range tagsData {
			tags[index] = v.String()
		}
		a.Tags = tags
		ret = append(ret, a)
		return true
	})
	return ret
}
type Order string
var (
	OrderDateDSC Order = ""
	OrderDateASC Order = "date"
)
type ContentRating string
var (
	ContentRatingAll ContentRating = ""
	ContentRatingSafe ContentRating = "safe"
	ContentRatingR18 ContentRating = "r18"
)
type SearchMode string
var (
	SearchModeTag SearchMode = ""
	SearchModePartialTag SearchMode = "s_tag"
	SearchModeTitleOrCaption SearchMode = "s_tc"
)
type SearchOptions struct {
	Page              int
	Order             Order
	ContentRating     ContentRating
	Mode              SearchMode
	WidthLessThan     int64
	WidthGreaterThan  int64
	HeightLessThan    int64
	HeightGreaterThan int64
}
type SearchOption func(*SearchOptions)
func SearchOptionPage(page int) SearchOption {
	return func(so *SearchOptions) {
		so.Page = page
	}
}
func SearchOptionOrder(order Order) SearchOption {
	return func(so *SearchOptions) {
		so.Order = order
	}
}