style: fix linter nits

This commit is contained in:
2026-06-13 21:31:42 +02:00
parent ea411e5feb
commit 7523215a71
2 changed files with 5 additions and 5 deletions

View File

@@ -275,7 +275,7 @@ func (s *playbackService) resolveStreamResult(ctx context.Context, animeID int,
}
func (s *playbackService) buildModeSource(res *domain.StreamResult) domain.ModeSource {
var subtitles []domain.SubtitleItem
subtitles := make([]domain.SubtitleItem, 0, len(res.Subtitles))
for _, sub := range res.Subtitles {
token, _ := s.SignProxyToken(sub.URL, res.Referer, "subtitle")
subtitles = append(subtitles, domain.SubtitleItem{

View File

@@ -53,12 +53,12 @@ func Post[T any](ctx context.Context, httpClient *http.Client, url string, query
}
defer func() { _ = resp.Body.Close() }()
max := opts.BodyMax
if max <= 0 {
max = 2 << 20
bodyMax := opts.BodyMax
if bodyMax <= 0 {
bodyMax = 2 << 20
}
respBody, err := io.ReadAll(io.LimitReader(resp.Body, max))
respBody, err := io.ReadAll(io.LimitReader(resp.Body, bodyMax))
if err != nil {
return zero, fmt.Errorf("graphql: read response: %w", err)
}