Documentation
¶
Index ¶
- type Manager
- func (m *Manager) GetOrCreateClient(instance *model.ConfigInstance) (any, error)
- func (m *Manager) GetOrCreateLidarrClient(instanceName, url, apiKey string) (*lidarr.Lidarr, error)
- func (m *Manager) GetOrCreateRadarrClient(instanceName, url, apiKey string) (*radarr.Radarr, error)
- func (m *Manager) GetOrCreateReadarrClient(instanceName, url, apiKey string) (*readarr.Readarr, error)
- func (m *Manager) GetOrCreateSonarrClient(instanceName, url, apiKey string) (*sonarr.Sonarr, error)
- func (m *Manager) GetOrCreateSportarrClient(instanceName, url, apiKey string) (*Sportarr, error)
- func (m *Manager) GetOrCreateWhisparrClient(instanceName, url, apiKey string) (*sonarr.Sonarr, error)
- func (m *Manager) TestConnection(ctx context.Context, instanceType, url, apiKey string) error
- type Sportarr
- type SportarrQueueItem
- type SportarrStatusMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
NewManager creates an arrs client manager. httpClient is shared with every starr.Config, so its Transport (incl. proxy) and Timeout apply to all Radarr/Sonarr/Lidarr/Readarr/Whisparr requests. When nil, a no-proxy 30s default client is used.
func (*Manager) GetOrCreateClient ¶
func (m *Manager) GetOrCreateClient(instance *model.ConfigInstance) (any, error)
GetOrCreateClient is a helper to get or create the appropriate client
func (*Manager) GetOrCreateLidarrClient ¶ added in v0.3.0
GetOrCreateLidarrClient gets or creates a Lidarr client for an instance
func (*Manager) GetOrCreateRadarrClient ¶
GetOrCreateRadarrClient gets or creates a Radarr client for an instance
func (*Manager) GetOrCreateReadarrClient ¶ added in v0.3.0
func (m *Manager) GetOrCreateReadarrClient(instanceName, url, apiKey string) (*readarr.Readarr, error)
GetOrCreateReadarrClient gets or creates a Readarr client for an instance
func (*Manager) GetOrCreateSonarrClient ¶
GetOrCreateSonarrClient gets or creates a Sonarr client for an instance
func (*Manager) GetOrCreateSportarrClient ¶ added in v0.3.0
GetOrCreateSportarrClient gets or creates a native Sportarr client for an instance
type Sportarr ¶ added in v0.3.0
type Sportarr struct {
// contains filtered or unexported fields
}
Sportarr is a thin native HTTP client for Sportarr.
Unlike Sonarr/Radarr/Lidarr/Readarr/Whisparr, Sportarr is NOT driveable through the golift.io/starr library: its /api/v3 surface is a narrow Sonarr-compat shim where only system/status and indexer are real, while /api/v3/queue and /api/v3/command fall through to the SPA. Sportarr's real, JSON-returning API lives at the unversioned /api/* paths (queue, history, pending-imports), so we talk to those directly here.
The main management value AltMount adds for Sportarr is queue cleanup; Sportarr already self-imports finished downloads on its own poll interval.
func NewSportarr ¶ added in v0.3.0
NewSportarr builds a native Sportarr client. The shared *http.Client carries the manager's proxy/timeout configuration.
func (*Sportarr) DeleteQueueItem ¶ added in v0.3.0
DeleteQueueItem removes a queue item, also instructing Sportarr to remove the download from the (AltMount) download client. It does not blocklist.
func (*Sportarr) DeleteQueueItemBlocklist ¶ added in v0.3.0
DeleteQueueItemBlocklist removes a queue item and blocklists the release so the same NZB is not grabbed again, prompting Sportarr to search for a replacement.
func (*Sportarr) GetQueue ¶ added in v0.3.0
func (s *Sportarr) GetQueue(ctx context.Context) ([]SportarrQueueItem, error)
GetQueue returns the current Sportarr queue. Sportarr's native /api/queue may return either a bare JSON array or a paged object with a "records" array, so we tolerate both shapes.
type SportarrQueueItem ¶ added in v0.3.0
type SportarrQueueItem struct {
ID int64 `json:"id"`
Title string `json:"title"`
Status sportarrStatus `json:"status"`
Protocol string `json:"protocol"`
DownloadClient sportarrRef `json:"downloadClient"`
DownloadID string `json:"downloadId"`
Indexer string `json:"indexer"`
OutputPath string `json:"outputPath"`
TrackedDownloadStatus string `json:"trackedDownloadStatus"`
TrackedDownloadState string `json:"trackedDownloadState"`
StatusMessages sportarrStatusMessages `json:"statusMessages"`
}
SportarrQueueItem maps the fields of a Sportarr native queue record that the queue-cleanup worker needs. Field names follow the Servarr convention; unknown fields are ignored by the JSON decoder. status, statusMessages and downloadClient use tolerant types because their wire shapes differ between Sportarr builds and a mismatch would otherwise fail the whole queue decode.
type SportarrStatusMessage ¶ added in v0.3.0
type SportarrStatusMessage struct {
Title string `json:"title"`
Messages []string `json:"messages"`
}
SportarrStatusMessage mirrors the Servarr status-message shape used by the queue-cleanup allowlist matching.