feat: add comments and cleanup unused imports across codebase

This commit is contained in:
2026-05-10 20:00:04 +02:00
parent b152e246ff
commit e48d95cb4e
68 changed files with 560 additions and 88 deletions

View File

@@ -7,6 +7,7 @@ import (
"time"
)
// GetEpisodes returns episode list for a specific page.
func (c *Client) GetEpisodes(ctx context.Context, animeID int, page int) (EpisodesResponse, error) {
if page < 1 {
page = 1
@@ -20,6 +21,7 @@ func (c *Client) GetEpisodes(ctx context.Context, animeID int, page int) (Episod
return result, err
}
// GetAllEpisodes fetches all pages of episodes in parallel and flattens results.
func (c *Client) GetAllEpisodes(ctx context.Context, animeID int) ([]Episode, error) {
// First page to get total pages
first, err := c.GetEpisodes(ctx, animeID, 1)
@@ -67,6 +69,7 @@ func (c *Client) GetAllEpisodes(ctx context.Context, animeID int) ([]Episode, er
return result, nil
}
// GetEpisodesRange fetches episodes from startPage to endPage sequentially.
func (c *Client) GetEpisodesRange(ctx context.Context, animeID int, startPage, endPage int) ([]Episode, error) {
var all []Episode
for page := startPage; page <= endPage; page++ {