chore: go fixes
This commit is contained in:
@@ -316,10 +316,7 @@ func (c *Client) fetchWithRetry(ctx context.Context, urlStr string, out any) err
|
||||
|
||||
if retryable && attempt < maxRetries-1 {
|
||||
resp.Body.Close()
|
||||
delay := retryDelay(attempt)
|
||||
if retryAfter > delay {
|
||||
delay = retryAfter
|
||||
}
|
||||
delay := max(retryAfter, retryDelay(attempt))
|
||||
|
||||
if retryErr := waitForRetry(ctx, delay); retryErr != nil {
|
||||
return retryErr
|
||||
|
||||
@@ -100,16 +100,16 @@ func (a Anime) ShortDuration() string {
|
||||
return ""
|
||||
}
|
||||
// Duration format: "23 min per ep" or "1 hr 30 min"
|
||||
var num string
|
||||
var num strings.Builder
|
||||
for _, c := range a.Duration {
|
||||
if c >= '0' && c <= '9' {
|
||||
num += string(c)
|
||||
} else if c == ' ' && num != "" {
|
||||
num.WriteString(string(c))
|
||||
} else if c == ' ' && num.String() != "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
if num != "" {
|
||||
return num + "m"
|
||||
if num.String() != "" {
|
||||
return num.String() + "m"
|
||||
}
|
||||
return a.Duration
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user