Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches data from the AniList GraphQL API.
func NewWithTimeout ¶ added in v1.0.5
NewWithTimeout creates a new AniList client with the given HTTP timeout.
func (*Client) FetchSeason ¶
func (c *Client) FetchSeason(ctx context.Context, season string, year int, maxResults int, formats []string) ([]Show, error)
FetchSeason returns anime for the given season, year, and formats. Results are capped at maxResults. Paginates through AniList's 50-per-page limit.
type RelationBlock ¶
type RelationBlock struct {
Edges []RelationEdge `json:"edges"`
}
RelationBlock holds the edges wrapper.
type RelationEdge ¶
type RelationEdge struct {
Node RelationNode `json:"node"`
RelationType string `json:"relationType"`
}
RelationEdge represents a related media entry.
type RelationNode ¶
type RelationNode struct {
ID int `json:"id"`
IDMal *int `json:"idMal"`
Title Title `json:"title"`
}
RelationNode holds minimal data for a related media entry.
type Show ¶
type Show struct {
ID int `json:"id"`
IDMal *int `json:"idMal"`
Title Title `json:"title"`
Format string `json:"format"`
Episodes *int `json:"episodes"`
Duration *int `json:"duration"`
Genres []string `json:"genres"`
Tags []Tag `json:"tags"`
Status string `json:"status"`
StartDate FuzzyDate `json:"startDate"`
Relations *RelationBlock `json:"relations,omitempty"`
}
Show represents an anime show from the AniList API.
func (Show) DisplayTitle ¶
DisplayTitle returns the English title if available, falling back to romaji.
func (Show) HasTag ¶
HasTag returns true if the show has a tag matching the given name (case-insensitive).
func (Show) IsNew ¶
IsNew returns true if the show is not a sequel or spin-off of an existing franchise. A show is considered "new" if it has no PREQUEL or PARENT relations.
func (Show) IsSeries ¶
IsSeries returns true if the show is a series (TV, ONA) rather than a movie (MOVIE, OVA, SPECIAL).
func (Show) IsWinterStart ¶
IsWinterStart returns true if the show's start date month falls within the winter anime season (December through March). Shows with unknown start dates are kept (returns true) since they cannot be ruled out. AniList's winter season spans December of the previous calendar year through March of the current year, so months 12, 1, 2, and 3 are valid.
func (Show) IsWithinMonths ¶
IsWithinMonths returns true if the show's start date is within the given number of months from now. If the start date is unknown, returns true (don't filter out shows with unknown dates).
func (Show) SkipByDuration ¶
SkipByDuration returns true if the show should be skipped because its per-episode duration is ≤ 10 minutes.