Documentation
¶
Overview ¶
Package sonarrimport fetches data from a running Sonarr instance and creates matching records in Pilot's database using the existing service layer. It is used only for the one-time migration wizard in the UI.
Index ¶
- type CategoryResult
- type Client
- func (c *Client) GetDownloadClients(ctx context.Context) ([]sonarrDownloadClient, error)
- func (c *Client) GetIndexers(ctx context.Context) ([]sonarrIndexer, error)
- func (c *Client) GetQualityProfiles(ctx context.Context) ([]sonarrProfile, error)
- func (c *Client) GetRootFolders(ctx context.Context) ([]sonarrRootFolder, error)
- func (c *Client) GetSeries(ctx context.Context) ([]sonarrSeries, error)
- func (c *Client) GetStatus(ctx context.Context) (*sonarrStatus, error)
- type ClientPreview
- type FolderPreview
- type ImportOptions
- type ImportResult
- type IndexerPreview
- type PreviewResult
- type ProfilePreview
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryResult ¶
type CategoryResult struct {
Imported int `json:"imported"`
Skipped int `json:"skipped"`
Failed int `json:"failed"`
}
CategoryResult holds import statistics for a single category.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client for the Sonarr v3 API.
func NewClient ¶
NewClient creates a new Sonarr API client. baseURL should be the root URL of the Sonarr instance, e.g. "http://sonarr.local:8989".
func (*Client) GetDownloadClients ¶
func (*Client) GetIndexers ¶
func (*Client) GetQualityProfiles ¶
func (*Client) GetRootFolders ¶
type ClientPreview ¶
type ClientPreview struct {
ID int `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
}
ClientPreview is a summary of a Sonarr download client.
type FolderPreview ¶
FolderPreview is a summary of a Sonarr root folder.
type ImportOptions ¶
type ImportOptions struct {
QualityProfiles bool `json:"quality_profiles"`
Libraries bool `json:"libraries"`
Indexers bool `json:"indexers"`
DownloadClients bool `json:"download_clients"`
Series bool `json:"series"`
}
ImportOptions controls which categories are imported.
type ImportResult ¶
type ImportResult struct {
QualityProfiles CategoryResult `json:"quality_profiles"`
Libraries CategoryResult `json:"libraries"`
Indexers CategoryResult `json:"indexers"`
DownloadClients CategoryResult `json:"download_clients"`
Series CategoryResult `json:"series"`
Errors []string `json:"errors"`
}
ImportResult reports how many records were created per category.
type IndexerPreview ¶
type IndexerPreview struct {
ID int `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
}
IndexerPreview is a summary of a Sonarr indexer.
type PreviewResult ¶
type PreviewResult struct {
Version string `json:"version"`
SeriesCount int `json:"series_count"`
QualityProfiles []ProfilePreview `json:"quality_profiles"`
RootFolders []FolderPreview `json:"root_folders"`
Indexers []IndexerPreview `json:"indexers"`
DownloadClients []ClientPreview `json:"download_clients"`
}
PreviewResult summarises what would be imported from a Sonarr instance.
type ProfilePreview ¶
ProfilePreview is a summary of a Sonarr quality profile.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service orchestrates the one-time import from a Sonarr instance.
func NewService ¶
func NewService( shows *show.Service, qualities *quality.Service, libraries *library.Service, indexers *indexer.Service, downloaders *downloader.Service, ) *Service
NewService creates an import Service wired to the given core services.
func (*Service) Execute ¶
func (s *Service) Execute(ctx context.Context, sonarrURL, apiKey string, opts ImportOptions) (*ImportResult, error)
Execute imports data from Sonarr into Pilot according to opts.