diff --git a/pkg/apps/apppkg/sabnzbd/sabnzbd.go b/pkg/apps/apppkg/sabnzbd/sabnzbd.go index 8f2b7da3b..6a87cc91d 100644 --- a/pkg/apps/apppkg/sabnzbd/sabnzbd.go +++ b/pkg/apps/apppkg/sabnzbd/sabnzbd.go @@ -112,7 +112,18 @@ type HistorySlots struct { ActionLine string `json:"action_line"` Size string `json:"size"` Loaded bool `json:"loaded"` - Retry int `json:"retry"` + Retry Bool `json:"retry"` +} + +// Bool exists because once upon a time sab changed the retry value from bool to int. +// https://github.com/sabnzbd/sabnzbd/issues/2911 +type Bool bool + +func (f *Bool) UnmarshalJSON(b []byte) error { + txt := strings.Trim(string(b), `"`) + *f = Bool(txt == "true" || (txt != "0" && txt != "false")) + + return nil } //nolint:tagliatelle diff --git a/pkg/client/client_windows.go b/pkg/client/client_windows.go index 6d5c20cf8..3f3c53efe 100644 --- a/pkg/client/client_windows.go +++ b/pkg/client/client_windows.go @@ -87,7 +87,7 @@ func (c *Client) startAutoUpdater(ctx context.Context, dur time.Duration) { } ticker := time.NewTicker(dur) - for range ticker.C { // the ticker never exits. + for range ticker.C { // This is a never-ending loop. if err := c.checkAndUpdate(ctx, "automatic"); err != nil { c.Errorf("Auto-Update Failed: %v", err) }