feat: add discover page with surprise me and deduplication

This commit is contained in:
2026-05-02 16:27:16 +02:00
committed by Mikkel Elvers
parent e89e05c6e8
commit c708afe4fe
7 changed files with 231 additions and 9 deletions

View File

@@ -83,3 +83,17 @@ func (c *Client) GetSeasonsUpcoming(ctx context.Context, page int) (TopAnimeResu
HasNextPage: result.Pagination.HasNextPage,
}, nil
}
func (c *Client) GetRandomAnime(ctx context.Context) (Anime, error) {
var result struct {
Data Anime `json:"data"`
}
reqURL := fmt.Sprintf("%s/random/anime", c.baseURL)
err := c.fetchWithRetry(ctx, reqURL, &result)
if err != nil {
return Anime{}, err
}
return result.Data, nil
}