Files
decypharr/pkg/arr/refresh.go
Mukhtar Akere f93d489956 Fix regex
2025-03-21 17:55:19 +01:00

26 lines
424 B
Go

package arr
import (
"fmt"
"net/http"
"strconv"
)
func (a *Arr) Refresh() error {
payload := struct {
Name string `json:"name"`
}{
Name: "RefreshMonitoredDownloads",
}
resp, err := a.Request(http.MethodPost, "api/v3/command", payload)
if err == nil && resp != nil {
statusOk := strconv.Itoa(resp.StatusCode)[0] == '2'
if statusOk {
return nil
}
}
return fmt.Errorf("failed to refresh: %v", err)
}