func (u *Unpackerr) getSonarrQueue() {
	for _, server := range u.Sonarr {
		if server.APIKey == "" {
			u.Debugf("Sonarr (%s): skipped, no API key", server.URL)
			continue
		}
		queue, err := server.GetQueue(DefaultQueuePageSize, 1)
		if err != nil {
			u.Printf("[ERROR] Sonarr (%s): %v", server.URL, err)
			return
		}
		server.Queue = queue
		u.Printf("[Sonarr] Updated (%s): %d Items Queued", server.URL, len(queue.Records))
	}
}
getSonarrQueue saves the Sonarr Queue(s).
package unpackerr
import (
	"fmt"
	"strings"
	"sync"
	"golift.io/cnfg"
	"golift.io/starr"
	"golift.io/starr/sonarr"
)
type SonarrConfig struct {
	starr.Config
	Path           string        `json:"path" toml:"path" xml:"path" yaml:"path"`
	Paths          []string      `json:"paths" toml:"paths" xml:"paths" yaml:"paths"`
	Protocols      string        `json:"protocols" toml:"protocols" xml:"protocols" yaml:"protocols"`
	DeleteOrig     bool          `json:"delete_orig" toml:"delete_orig" xml:"delete_orig" yaml:"delete_orig"`
	DeleteDelay    cnfg.Duration `json:"delete_delay" toml:"delete_delay" xml:"delete_delay" yaml:"delete_delay"`
	Queue          *sonarr.Queue `json:"-" toml:"-" xml:"-" yaml:"-"`
	sync.RWMutex   `json:"-" toml:"-" xml:"-" yaml:"-"`
	*sonarr.Sonarr `json:"-" toml:"-" xml:"-" yaml:"-"`
}
func (u *Unpackerr) validateSonarr() error {
	tmp := u.Sonarr[:0]
	for i := range u.Sonarr {
		if u.Sonarr[i].URL == "" {
			u.Printf("Missing Sonarr URL in one of your configurations, skipped and ignored.")
			continue
		}
		if !strings.HasPrefix(u.Sonarr[i].URL, "http://") && !strings.HasPrefix(u.Sonarr[i].URL, "https://") {
			return fmt.Errorf("%w: (sonarr) %s", ErrInvalidURL, u.Sonarr[i].URL)
		}
		if len(u.Sonarr[i].APIKey) != apiKeyLength {
			u.Printf("Sonarr (%s): ignored, invalid API key: %s", u.Sonarr[i].URL, u.Sonarr[i].APIKey)
		}
		if u.Sonarr[i].Timeout.Duration == 0 {
			u.Sonarr[i].Timeout.Duration = u.Timeout.Duration
		}
		if u.Sonarr[i].DeleteDelay.Duration == 0 {
			u.Sonarr[i].DeleteDelay.Duration = u.DeleteDelay.Duration
		}
		if u.Sonarr[i].Path != "" {
			u.Sonarr[i].Paths = append(u.Sonarr[i].Paths, u.Sonarr[i].Path)
		}
		if len(u.Sonarr[i].Paths) == 0 {
			u.Sonarr[i].Paths = []string{defaultSavePath}
		}
		if u.Sonarr[i].Protocols == "" {
			u.Sonarr[i].Protocols = defaultProtocol
		}
		u.Sonarr[i].Sonarr = sonarr.New(&u.Sonarr[i].Config)
		tmp = append(tmp, u.Sonarr[i])
	}
	u.Sonarr = tmp
	return nil
}
func (u *Unpackerr) logSonarr() {
	if c := len(u.Sonarr); c == 1 {
		u.Printf(" => Sonarr Config: 1 server: %s, apikey:%v, timeout:%v, verify ssl:%v, protos:%s, "+
			"delete_orig: %v, delete_delay: %v, paths:%q",
			u.Sonarr[0].URL, u.Sonarr[0].APIKey != "", u.Sonarr[0].Timeout,
			u.Sonarr[0].ValidSSL, u.Sonarr[0].Protocols, u.Sonarr[0].DeleteOrig,
			u.Sonarr[0].DeleteDelay.Duration, u.Sonarr[0].Paths)
	} else {
		u.Print(" => Sonarr Config:", c, "servers")
		for _, f := range u.Sonarr {
			u.Printf(" =>    Server: %s, apikey:%v, timeout:%v, verify ssl:%v, protos:%s, "+
				"delete_orig: %v, delete_delay: %v, paths:%q",
				f.URL, f.APIKey != "", f.Timeout, f.ValidSSL, f.Protocols,
				f.DeleteOrig, f.DeleteDelay.Duration, f.Paths)
		}
	}
}