Skip to content

Commit

Permalink
Merge branch 'dn2_sab_fix' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Jul 19, 2024
2 parents 8c25354 + e4ed6e7 commit 485fb63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion pkg/apps/apppkg/sabnzbd/sabnzbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 485fb63

Please sign in to comment.