style: fix linter nits
This commit is contained in:
@@ -275,7 +275,7 @@ func (s *playbackService) resolveStreamResult(ctx context.Context, animeID int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *playbackService) buildModeSource(res *domain.StreamResult) domain.ModeSource {
|
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 {
|
for _, sub := range res.Subtitles {
|
||||||
token, _ := s.SignProxyToken(sub.URL, res.Referer, "subtitle")
|
token, _ := s.SignProxyToken(sub.URL, res.Referer, "subtitle")
|
||||||
subtitles = append(subtitles, domain.SubtitleItem{
|
subtitles = append(subtitles, domain.SubtitleItem{
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ func Post[T any](ctx context.Context, httpClient *http.Client, url string, query
|
|||||||
}
|
}
|
||||||
defer func() { _ = resp.Body.Close() }()
|
defer func() { _ = resp.Body.Close() }()
|
||||||
|
|
||||||
max := opts.BodyMax
|
bodyMax := opts.BodyMax
|
||||||
if max <= 0 {
|
if bodyMax <= 0 {
|
||||||
max = 2 << 20
|
bodyMax = 2 << 20
|
||||||
}
|
}
|
||||||
|
|
||||||
respBody, err := io.ReadAll(io.LimitReader(resp.Body, max))
|
respBody, err := io.ReadAll(io.LimitReader(resp.Body, bodyMax))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return zero, fmt.Errorf("graphql: read response: %w", err)
|
return zero, fmt.Errorf("graphql: read response: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user