arr

package module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 10 Imported by: 8

Documentation

Overview

Package arr provides shared types and a base HTTP client for interacting with *arr application APIs (Sonarr, Radarr, Lidarr, Readarr, Prowlarr, Bazarr, Whisparr, Seerr, Autobrr, FlareSolverr, Jackett, Mylar, NZBHydra).

The BaseClient handles authentication, request construction, and response parsing common to all *arr services. Individual service packages build on top of this foundation.

Authentication

Every request is authenticated via the X-Api-Key header. Pass the API key when constructing a BaseClient:

c, err := arr.NewBaseClient("http://localhost:8989", "your-api-key")

Error Handling

Non-2xx responses are returned as *APIError, which exposes the HTTP status code, request method, path, and response body for inspection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// StatusCode is the HTTP status code returned by the server.
	StatusCode int
	// Method is the HTTP method of the failed request.
	Method string
	// Path is the request path that produced the error.
	Path string
	// Body is the raw response body, useful for debugging.
	Body []byte
}

APIError represents a non-2xx HTTP response from an *arr API.

func (*APIError) Error

func (e *APIError) Error() string

Error implements the error interface.

type AutoTaggingResource added in v1.1.0

type AutoTaggingResource struct {
	ID                      int                        `json:"id"`
	Name                    string                     `json:"name"`
	RemoveTagsAutomatically bool                       `json:"removeTagsAutomatically"`
	Tags                    []int                      `json:"tags"`
	Specifications          []AutoTaggingSpecification `json:"specifications"`
}

AutoTaggingResource represents an auto-tagging rule.

type AutoTaggingSpecification added in v1.1.0

type AutoTaggingSpecification struct {
	ID                 int             `json:"id"`
	Name               string          `json:"name"`
	Implementation     string          `json:"implementation"`
	ImplementationName string          `json:"implementationName"`
	Negate             bool            `json:"negate"`
	Required           bool            `json:"required"`
	Fields             []ProviderField `json:"fields"`
}

AutoTaggingSpecification is a condition in an auto-tagging rule.

type Backup added in v1.1.0

type Backup struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Path string `json:"path"`
	Type string `json:"type"`
	Size int64  `json:"size"`
	Time string `json:"time"`
}

Backup represents a backup file available on the server.

type BaseClient

type BaseClient struct {
	// contains filtered or unexported fields
}

BaseClient is a low-level HTTP client shared by all *arr service clients. It handles authentication, JSON marshaling, and error wrapping.

func NewBaseClient

func NewBaseClient(baseURL, apiKey string, opts ...Option) (*BaseClient, error)

NewBaseClient creates a BaseClient targeting the given base URL. The apiKey is sent in the X-Api-Key header on every request.

func (*BaseClient) Delete

func (c *BaseClient) Delete(ctx context.Context, path string, body, dst any) error

Delete performs an authenticated DELETE request with an optional JSON body and decodes the response into dst.

func (*BaseClient) Get

func (c *BaseClient) Get(ctx context.Context, path string, dst any) error

Get performs an authenticated GET request and decodes the JSON response into dst.

func (*BaseClient) GetRaw added in v1.1.0

func (c *BaseClient) GetRaw(ctx context.Context, path string) ([]byte, error)

GetRaw performs an authenticated GET request and returns the raw response body as bytes. Use this for endpoints that return non-JSON content (e.g. plain text log files).

func (*BaseClient) Head added in v1.1.0

func (c *BaseClient) Head(ctx context.Context, path string) error

Head performs an authenticated HEAD request and returns nil on a 2xx status.

func (*BaseClient) Patch

func (c *BaseClient) Patch(ctx context.Context, path string, body, dst any) error

Patch performs an authenticated PATCH request with a JSON body and decodes the response into dst.

func (*BaseClient) Post

func (c *BaseClient) Post(ctx context.Context, path string, body, dst any) error

Post performs an authenticated POST request with a JSON body and decodes the response into dst.

func (*BaseClient) Put

func (c *BaseClient) Put(ctx context.Context, path string, body, dst any) error

Put performs an authenticated PUT request with a JSON body and decodes the response into dst.

func (*BaseClient) Upload added in v1.1.0

func (c *BaseClient) Upload(ctx context.Context, path, fieldName, fileName string, fileData io.Reader) error

Upload performs an authenticated multipart file upload via POST. The file content is sent as a form field with the given fieldName and fileName.

type BlocklistBulkResource added in v1.1.0

type BlocklistBulkResource struct {
	IDs []int `json:"ids"`
}

BlocklistBulkResource is the request body for bulk blocklist operations.

type BlocklistResource added in v1.1.0

type BlocklistResource struct {
	ID            int                `json:"id"`
	SeriesID      int                `json:"seriesId,omitempty"`
	MovieID       int                `json:"movieId,omitempty"`
	ArtistID      int                `json:"artistId,omitempty"`
	AuthorID      int                `json:"authorId,omitempty"`
	SourceTitle   string             `json:"sourceTitle"`
	Languages     []LanguageResource `json:"languages"`
	Quality       any                `json:"quality"`
	CustomFormats []any              `json:"customFormats"`
	Date          string             `json:"date"`
	Protocol      string             `json:"protocol"`
	Indexer       string             `json:"indexer"`
	Message       string             `json:"message"`
}

BlocklistResource represents a blocklisted release.

type CalendarFeedParams added in v1.1.0

type CalendarFeedParams struct {
	PastDays    int
	FutureDays  int
	Unmonitored bool
	Tags        []int
}

CalendarFeedParams holds optional parameters for the iCal calendar feed.

type CommandRequest

type CommandRequest struct {
	Name string `json:"name"`
}

CommandRequest is the payload sent to /api/v3/command.

type CommandResponse

type CommandResponse struct {
	ID                  int    `json:"id"`
	Name                string `json:"name"`
	Message             string `json:"message"`
	Started             string `json:"started"`
	Ended               string `json:"ended"`
	Status              string `json:"status"`
	Priority            string `json:"priority"`
	Trigger             string `json:"trigger"`
	StateChangeTime     string `json:"stateChangeTime"`
	SendUpdatesToClient bool   `json:"sendUpdatesToClient"`
	UpdateScheduledTask bool   `json:"updateScheduledTask"`
}

CommandResponse is the reply from /api/v3/command.

type CustomFilterResource added in v1.1.0

type CustomFilterResource struct {
	ID      int                     `json:"id"`
	Type    string                  `json:"type"`
	Label   string                  `json:"label"`
	Filters []CustomFilterSpecifier `json:"filters"`
}

CustomFilterResource represents a custom UI filter.

type CustomFilterSpecifier added in v1.1.0

type CustomFilterSpecifier struct {
	Key   string   `json:"key"`
	Value []string `json:"value"`
	Type  string   `json:"type,omitempty"`
}

CustomFilterSpecifier is a single filter criterion inside a CustomFilterResource.

type CustomFormatBulkResource added in v1.1.0

type CustomFormatBulkResource struct {
	IDs                             []int `json:"ids"`
	IncludeCustomFormatWhenRenaming *bool `json:"includeCustomFormatWhenRenaming,omitempty"`
}

CustomFormatBulkResource is used for bulk operations on custom formats.

type CustomFormatResource added in v1.1.0

type CustomFormatResource struct {
	ID                              int                         `json:"id"`
	Name                            string                      `json:"name"`
	IncludeCustomFormatWhenRenaming bool                        `json:"includeCustomFormatWhenRenaming"`
	Specifications                  []CustomFormatSpecification `json:"specifications"`
}

CustomFormatResource describes a custom format with its specifications.

type CustomFormatSpecification added in v1.1.0

type CustomFormatSpecification struct {
	ID                 int             `json:"id"`
	Name               string          `json:"name"`
	Implementation     string          `json:"implementation"`
	ImplementationName string          `json:"implementationName"`
	Negate             bool            `json:"negate"`
	Required           bool            `json:"required"`
	Fields             []ProviderField `json:"fields"`
}

CustomFormatSpecification is one condition inside a CustomFormatResource.

type DelayProfileResource added in v1.1.0

type DelayProfileResource struct {
	ID                             int    `json:"id"`
	EnableUsenet                   bool   `json:"enableUsenet"`
	EnableTorrent                  bool   `json:"enableTorrent"`
	PreferredProtocol              string `json:"preferredProtocol"`
	UsenetDelay                    int    `json:"usenetDelay"`
	TorrentDelay                   int    `json:"torrentDelay"`
	BypassIfHighestQuality         bool   `json:"bypassIfHighestQuality"`
	BypassIfAboveCustomFormatScore bool   `json:"bypassIfAboveCustomFormatScore"`
	MinimumCustomFormatScore       int    `json:"minimumCustomFormatScore"`
	Order                          int    `json:"order"`
	Tags                           []int  `json:"tags"`
}

DelayProfileResource represents a delay profile configuration.

type DiskSpace

type DiskSpace struct {
	Path       string `json:"path"`
	Label      string `json:"label"`
	FreeSpace  int64  `json:"freeSpace"`
	TotalSpace int64  `json:"totalSpace"`
}

DiskSpace contains disk usage information.

type DownloadClientConfigResource added in v1.1.0

type DownloadClientConfigResource struct {
	ID                                        int    `json:"id"`
	DownloadClientWorkingFolders              string `json:"downloadClientWorkingFolders"`
	EnableCompletedDownloadHandling           bool   `json:"enableCompletedDownloadHandling"`
	AutoRedownloadFailed                      bool   `json:"autoRedownloadFailed"`
	AutoRedownloadFailedFromInteractiveSearch bool   `json:"autoRedownloadFailedFromInteractiveSearch"`
}

DownloadClientConfigResource holds download client global settings.

type HealthCheck

type HealthCheck struct {
	Source  string `json:"source"`
	Type    string `json:"type"`
	Message string `json:"message"`
	WikiURL string `json:"wikiUrl"`
}

HealthCheck represents a single health-check entry from /api/v3/health.

type HostConfigResource added in v1.1.0

type HostConfigResource struct {
	ID                        int    `json:"id"`
	BindAddress               string `json:"bindAddress"`
	Port                      int    `json:"port"`
	SslPort                   int    `json:"sslPort"`
	EnableSsl                 bool   `json:"enableSsl"`
	LaunchBrowser             bool   `json:"launchBrowser"`
	AuthenticationMethod      string `json:"authenticationMethod"`
	AuthenticationRequired    string `json:"authenticationRequired"`
	AnalyticsEnabled          bool   `json:"analyticsEnabled"`
	Username                  string `json:"username,omitempty"`
	Password                  string `json:"password,omitempty"`
	PasswordConfirmation      string `json:"passwordConfirmation,omitempty"`
	LogLevel                  string `json:"logLevel"`
	ConsoleLogLevel           string `json:"consoleLogLevel"`
	Branch                    string `json:"branch"`
	ApiKey                    string `json:"apiKey"`
	SslCertPath               string `json:"sslCertPath"`
	SslCertPassword           string `json:"sslCertPassword"`
	URLBase                   string `json:"urlBase"`
	InstanceName              string `json:"instanceName"`
	UpdateAutomatically       bool   `json:"updateAutomatically"`
	UpdateMechanism           string `json:"updateMechanism"`
	UpdateScriptPath          string `json:"updateScriptPath"`
	ProxyEnabled              bool   `json:"proxyEnabled"`
	ProxyType                 string `json:"proxyType"`
	ProxyHostname             string `json:"proxyHostname"`
	ProxyPort                 int    `json:"proxyPort"`
	ProxyUsername             string `json:"proxyUsername,omitempty"`
	ProxyPassword             string `json:"proxyPassword,omitempty"`
	ProxyBypassFilter         string `json:"proxyBypassFilter"`
	ProxyBypassLocalAddresses bool   `json:"proxyBypassLocalAddresses"`
	CertificateValidation     string `json:"certificateValidation"`
	BackupFolder              string `json:"backupFolder"`
	BackupInterval            int    `json:"backupInterval"`
	BackupRetention           int    `json:"backupRetention"`
}

HostConfigResource holds host/general configuration.

type ImportListExclusionResource added in v1.1.0

type ImportListExclusionResource struct {
	ID     int    `json:"id"`
	TvdbID int    `json:"tvdbId,omitempty"` // Sonarr
	TmdbID int    `json:"tmdbId,omitempty"` // Radarr
	Title  string `json:"title"`
	Year   int    `json:"year,omitempty"`
}

ImportListExclusionResource represents an import list exclusion entry.

type IndexerConfigResource added in v1.1.0

type IndexerConfigResource struct {
	ID              int `json:"id"`
	MinimumAge      int `json:"minimumAge"`
	Retention       int `json:"retention"`
	MaximumSize     int `json:"maximumSize"`
	RssSyncInterval int `json:"rssSyncInterval"`
}

IndexerConfigResource holds indexer global settings.

type IndexerFlagResource added in v1.1.0

type IndexerFlagResource struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

IndexerFlagResource describes an indexer flag.

type LanguageResource added in v1.1.0

type LanguageResource struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

LanguageResource is a simple id+name pair for languages in shared contexts.

type LogFileResource added in v1.1.0

type LogFileResource struct {
	ID            int    `json:"id"`
	Filename      string `json:"filename"`
	LastWriteTime string `json:"lastWriteTime"`
	ContentsURL   string `json:"contentsUrl"`
	DownloadURL   string `json:"downloadUrl"`
}

LogFileResource describes an available log file.

type LogRecord added in v1.1.0

type LogRecord struct {
	ID            int    `json:"id"`
	Time          string `json:"time"`
	Exception     string `json:"exception,omitempty"`
	ExceptionType string `json:"exceptionType,omitempty"`
	Level         string `json:"level"`
	Logger        string `json:"logger"`
	Message       string `json:"message"`
	Method        string `json:"method,omitempty"`
}

LogRecord is a single log entry returned by the /log endpoint.

type ManualImportReprocessResource added in v1.1.0

type ManualImportReprocessResource struct {
	ID           int    `json:"id"`
	Path         string `json:"path"`
	SeriesID     int    `json:"seriesId,omitempty"`
	MovieID      int    `json:"movieId,omitempty"`
	SeasonNumber int    `json:"seasonNumber,omitempty"`
	EpisodeIDs   []int  `json:"episodeIds,omitempty"`
	Quality      any    `json:"quality"`
	Languages    []any  `json:"languages"`
	ReleaseGroup string `json:"releaseGroup"`
	DownloadID   string `json:"downloadId"`
}

ManualImportReprocessResource is the body for manual import confirmation.

type ManualImportResource added in v1.1.0

type ManualImportResource struct {
	ID           int    `json:"id"`
	Path         string `json:"path"`
	RelativePath string `json:"relativePath"`
	FolderName   string `json:"folderName"`
	Name         string `json:"name"`
	Size         int64  `json:"size"`
	Quality      any    `json:"quality"`
	Languages    []any  `json:"languages"`
	ReleaseGroup string `json:"releaseGroup"`
	Rejections   []any  `json:"rejections"`
}

ManualImportResource represents a file available for manual import.

type MediaManagementConfigResource added in v1.1.0

type MediaManagementConfigResource struct {
	ID                                        int    `json:"id"`
	AutoUnmonitorPreviouslyDownloadedEpisodes bool   `json:"autoUnmonitorPreviouslyDownloadedEpisodes,omitempty"`
	AutoUnmonitorPreviouslyDownloadedMovies   bool   `json:"autoUnmonitorPreviouslyDownloadedMovies,omitempty"`
	RecycleBin                                string `json:"recycleBin"`
	RecycleBinCleanupDays                     int    `json:"recycleBinCleanupDays"`
	DownloadPropersAndRepacks                 string `json:"downloadPropersAndRepacks"`
	CreateEmptySeriesFolders                  bool   `json:"createEmptySeriesFolders,omitempty"`
	CreateEmptyMovieFolders                   bool   `json:"createEmptyMovieFolders,omitempty"`
	CreateEmptyArtistFolders                  bool   `json:"createEmptyArtistFolders,omitempty"`
	CreateEmptyAuthorFolders                  bool   `json:"createEmptyAuthorFolders,omitempty"`
	DeleteEmptyFolders                        bool   `json:"deleteEmptyFolders"`
	FileDate                                  string `json:"fileDate"`
	RescanAfterRefresh                        string `json:"rescanAfterRefresh"`
	AutoRenameFolders                         bool   `json:"autoRenameFolders"`
	PathsDefaultStatic                        bool   `json:"pathsDefaultStatic"`
	SetPermissionsLinux                       bool   `json:"setPermissionsLinux"`
	ChmodFolder                               string `json:"chmodFolder"`
	ChownGroup                                string `json:"chownGroup"`
	SkipFreeSpaceCheckWhenImporting           bool   `json:"skipFreeSpaceCheckWhenImporting"`
	MinimumFreeSpaceWhenImporting             int    `json:"minimumFreeSpaceWhenImporting"`
	CopyUsingHardlinks                        bool   `json:"copyUsingHardlinks"`
	UseScriptImport                           bool   `json:"useScriptImport"`
	ScriptImportPath                          string `json:"scriptImportPath,omitempty"`
	ImportExtraFiles                          bool   `json:"importExtraFiles"`
	ExtraFileExtensions                       string `json:"extraFileExtensions"`
	EnableMediaInfo                           bool   `json:"enableMediaInfo"`
}

MediaManagementConfigResource holds media management settings.

type NamingConfigResource added in v1.1.0

type NamingConfigResource struct {
	ID                       int    `json:"id"`
	RenameEpisodes           bool   `json:"renameEpisodes,omitempty"`
	ReplaceIllegalCharacters bool   `json:"replaceIllegalCharacters"`
	ColonReplacementFormat   string `json:"colonReplacementFormat"`
	StandardEpisodeFormat    string `json:"standardEpisodeFormat,omitempty"`
	DailyEpisodeFormat       string `json:"dailyEpisodeFormat,omitempty"`
	AnimeEpisodeFormat       string `json:"animeEpisodeFormat,omitempty"`
	SeriesFolderFormat       string `json:"seriesFolderFormat,omitempty"`
	SeasonFolderFormat       string `json:"seasonFolderFormat,omitempty"`
	SpecialsFolderFormat     string `json:"specialsFolderFormat,omitempty"`
	MultiEpisodeStyle        int    `json:"multiEpisodeStyle,omitempty"`
	// Radarr naming fields
	RenameMovies        bool   `json:"renameMovies,omitempty"`
	StandardMovieFormat string `json:"standardMovieFormat,omitempty"`
	MovieFolderFormat   string `json:"movieFolderFormat,omitempty"`
	// Lidarr naming fields
	RenameTracks         bool   `json:"renameTracks,omitempty"`
	StandardTrackFormat  string `json:"standardTrackFormat,omitempty"`
	MultiDiscTrackFormat string `json:"multiDiscTrackFormat,omitempty"`
	ArtistFolderFormat   string `json:"artistFolderFormat,omitempty"`
	// Readarr naming fields
	RenameBooks        bool   `json:"renameBooks,omitempty"`
	StandardBookFormat string `json:"standardBookFormat,omitempty"`
	AuthorFolderFormat string `json:"authorFolderFormat,omitempty"`
}

NamingConfigResource holds the file naming configuration.

type Option

type Option func(*BaseClient)

Option configures a BaseClient.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets a custom http.Client for the BaseClient.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout overrides the default HTTP request timeout.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent sets the User-Agent header sent with every request.

type PagingResource

type PagingResource[T any] struct {
	Page          int    `json:"page"`
	PageSize      int    `json:"pageSize"`
	SortKey       string `json:"sortKey"`
	SortDirection string `json:"sortDirection"`
	TotalRecords  int    `json:"totalRecords"`
	Records       []T    `json:"records"`
}

PagingResource wraps a paginated response from an *arr API.

type PreferredTerm added in v1.1.0

type PreferredTerm struct {
	Key   string `json:"key"`
	Value int    `json:"value"`
}

PreferredTerm is a scored term inside a ReleaseProfileResource.

type ProviderBulkResource added in v1.1.0

type ProviderBulkResource struct {
	IDs       []int  `json:"ids"`
	Tags      []int  `json:"tags,omitempty"`
	ApplyTags string `json:"applyTags,omitempty"`
}

ProviderBulkResource is used for bulk update operations on providers.

type ProviderField added in v1.1.0

type ProviderField struct {
	Order         int            `json:"order"`
	Name          string         `json:"name"`
	Label         string         `json:"label"`
	Unit          string         `json:"unit,omitempty"`
	HelpText      string         `json:"helpText,omitempty"`
	HelpLink      string         `json:"helpLink,omitempty"`
	Value         any            `json:"value"`
	Type          string         `json:"type"`
	Advanced      bool           `json:"advanced"`
	SelectOptions []SelectOption `json:"selectOptions,omitempty"`
}

ProviderField is a key/value field used in provider configuration (Notification, DownloadClient, Indexer, ImportList, Metadata).

type ProviderMessage added in v1.1.0

type ProviderMessage struct {
	Message string `json:"message"`
	Type    string `json:"type"`
}

ProviderMessage is a warning/info message attached to a provider.

type ProviderResource added in v1.1.0

type ProviderResource struct {
	ID                 int              `json:"id"`
	Name               string           `json:"name"`
	Implementation     string           `json:"implementation"`
	ImplementationName string           `json:"implementationName"`
	ConfigContract     string           `json:"configContract"`
	InfoLink           string           `json:"infoLink,omitempty"`
	Tags               []int            `json:"tags"`
	Fields             []ProviderField  `json:"fields"`
	Message            *ProviderMessage `json:"message,omitempty"`

	// Notification-specific
	OnGrab                                *bool `json:"onGrab,omitempty"`
	OnDownload                            *bool `json:"onDownload,omitempty"`
	OnUpgrade                             *bool `json:"onUpgrade,omitempty"`
	OnRename                              *bool `json:"onRename,omitempty"`
	OnSeriesAdd                           *bool `json:"onSeriesAdd,omitempty"`
	OnSeriesDelete                        *bool `json:"onSeriesDelete,omitempty"`
	OnEpisodeFileDelete                   *bool `json:"onEpisodeFileDelete,omitempty"`
	OnEpisodeFileDeleteForUpgrade         *bool `json:"onEpisodeFileDeleteForUpgrade,omitempty"`
	OnHealthIssue                         *bool `json:"onHealthIssue,omitempty"`
	OnHealthRestored                      *bool `json:"onHealthRestored,omitempty"`
	OnApplicationUpdate                   *bool `json:"onApplicationUpdate,omitempty"`
	OnManualInteractionRequired           *bool `json:"onManualInteractionRequired,omitempty"`
	IncludeHealthWarnings                 *bool `json:"includeHealthWarnings,omitempty"`
	SupportsOnGrab                        *bool `json:"supportsOnGrab,omitempty"`
	SupportsOnDownload                    *bool `json:"supportsOnDownload,omitempty"`
	SupportsOnUpgrade                     *bool `json:"supportsOnUpgrade,omitempty"`
	SupportsOnRename                      *bool `json:"supportsOnRename,omitempty"`
	SupportsOnSeriesAdd                   *bool `json:"supportsOnSeriesAdd,omitempty"`
	SupportsOnSeriesDelete                *bool `json:"supportsOnSeriesDelete,omitempty"`
	SupportsOnEpisodeFileDelete           *bool `json:"supportsOnEpisodeFileDelete,omitempty"`
	SupportsOnEpisodeFileDeleteForUpgrade *bool `json:"supportsOnEpisodeFileDeleteForUpgrade,omitempty"`
	SupportsOnHealthIssue                 *bool `json:"supportsOnHealthIssue,omitempty"`
	SupportsOnHealthRestored              *bool `json:"supportsOnHealthRestored,omitempty"`
	SupportsOnApplicationUpdate           *bool `json:"supportsOnApplicationUpdate,omitempty"`
	SupportsOnManualInteractionRequired   *bool `json:"supportsOnManualInteractionRequired,omitempty"`

	// Radarr movie notifications
	OnMovieAdded                *bool `json:"onMovieAdded,omitempty"`
	OnMovieDelete               *bool `json:"onMovieDelete,omitempty"`
	OnMovieFileDelete           *bool `json:"onMovieFileDelete,omitempty"`
	OnMovieFileDeleteForUpgrade *bool `json:"onMovieFileDeleteForUpgrade,omitempty"`

	// DownloadClient-specific
	Enable                   *bool  `json:"enable,omitempty"`
	Protocol                 string `json:"protocol,omitempty"`
	Priority                 *int   `json:"priority,omitempty"`
	RemoveCompletedDownloads *bool  `json:"removeCompletedDownloads,omitempty"`
	RemoveFailedDownloads    *bool  `json:"removeFailedDownloads,omitempty"`

	// Indexer-specific
	EnableRss               *bool `json:"enableRss,omitempty"`
	EnableAutomaticSearch   *bool `json:"enableAutomaticSearch,omitempty"`
	EnableInteractiveSearch *bool `json:"enableInteractiveSearch,omitempty"`
	SupportsRss             *bool `json:"supportsRss,omitempty"`
	SupportsSearch          *bool `json:"supportsSearch,omitempty"`

	// ImportList-specific
	EnableAuto         *bool  `json:"enableAuto,omitempty"`
	ShouldMonitor      string `json:"shouldMonitor,omitempty"`
	RootFolderPath     string `json:"rootFolderPath,omitempty"`
	QualityProfileID   *int   `json:"qualityProfileId,omitempty"`
	ListType           string `json:"listType,omitempty"`
	ListOrder          *int   `json:"listOrder,omitempty"`
	MinRefreshInterval string `json:"minRefreshInterval,omitempty"`

	// Metadata-specific
	MetadataEnable *bool `json:"metadataEnable,omitempty"`
}

ProviderResource is the shared shape for Notification, DownloadClient, Indexer, ImportList, and Metadata provider configurations in *arr APIs.

type ProviderTestResource added in v1.1.0

type ProviderTestResource = ProviderResource

ProviderTestResource wraps a provider body for test API calls.

type QualityDefinitionResource added in v1.1.0

type QualityDefinitionResource struct {
	ID            int     `json:"id"`
	Title         string  `json:"title"`
	Weight        int     `json:"weight"`
	MinSize       float64 `json:"minSize"`
	MaxSize       float64 `json:"maxSize"`
	PreferredSize float64 `json:"preferredSize"`
}

QualityDefinitionResource represents a quality size limit entry.

type QualityProfile

type QualityProfile struct {
	ID                int    `json:"id"`
	Name              string `json:"name"`
	UpgradeAllowed    bool   `json:"upgradeAllowed"`
	CutoffFormatScore int    `json:"cutoffFormatScore"`
	MinFormatScore    int    `json:"minFormatScore"`
}

QualityProfile describes a quality profile configured in the *arr app.

type QueueBulkResource added in v1.1.0

type QueueBulkResource struct {
	IDs []int `json:"ids"`
}

QueueBulkResource is the request body for bulk queue operations.

type QueueRecord

type QueueRecord struct {
	ID                      int             `json:"id"`
	Title                   string          `json:"title"`
	Size                    float64         `json:"size"`
	SizeLeft                float64         `json:"sizeleft"`
	Status                  string          `json:"status"`
	TrackedDownloadStatus   string          `json:"trackedDownloadStatus"`
	TrackedDownloadState    string          `json:"trackedDownloadState"`
	StatusMessages          []StatusMessage `json:"statusMessages"`
	DownloadID              string          `json:"downloadId"`
	Protocol                string          `json:"protocol"`
	DownloadClient          string          `json:"downloadClient"`
	Indexer                 string          `json:"indexer"`
	OutputPath              string          `json:"outputPath"`
	TimeleftEstimation      time.Duration   `json:"-"`
	EstimatedCompletionTime string          `json:"estimatedCompletionTime"`
	Added                   string          `json:"added"`
}

QueueRecord represents an item in the download queue.

type QueueStatusResource added in v1.1.0

type QueueStatusResource struct {
	TotalCount      int  `json:"totalCount"`
	Count           int  `json:"count"`
	UnknownCount    int  `json:"unknownCount"`
	Errors          bool `json:"errors"`
	Warnings        bool `json:"warnings"`
	UnknownErrors   bool `json:"unknownErrors"`
	UnknownWarnings bool `json:"unknownWarnings"`
}

QueueStatusResource reports the overall queue status.

type ReleaseProfileResource added in v1.1.0

type ReleaseProfileResource struct {
	ID        int             `json:"id"`
	Name      string          `json:"name,omitempty"`
	Enabled   bool            `json:"enabled"`
	Required  []string        `json:"required"`
	Ignored   []string        `json:"ignored"`
	Preferred []PreferredTerm `json:"preferred"`
	IndexerID int             `json:"indexerId"`
	Tags      []int           `json:"tags"`
}

ReleaseProfileResource configures preferred/required/ignored terms.

type ReleasePushResource added in v1.1.0

type ReleasePushResource struct {
	Title       string `json:"title"`
	DownloadURL string `json:"downloadUrl"`
	Protocol    string `json:"protocol"`
	PublishDate string `json:"publishDate"`
}

ReleasePushResource is the body for manually pushing a release.

type ReleaseResource added in v1.1.0

type ReleaseResource struct {
	GUID                     string  `json:"guid"`
	Quality                  any     `json:"quality"`
	CustomFormats            []any   `json:"customFormats"`
	CustomFormatScore        int     `json:"customFormatScore"`
	QualityWeight            int     `json:"qualityWeight"`
	Age                      int     `json:"age"`
	AgeHours                 float64 `json:"ageHours"`
	AgeMinutes               float64 `json:"ageMinutes"`
	Size                     int64   `json:"size"`
	IndexerID                int     `json:"indexerId"`
	Indexer                  string  `json:"indexer"`
	ReleaseGroup             string  `json:"releaseGroup"`
	SubGroup                 string  `json:"subGroup"`
	ReleaseHash              string  `json:"releaseHash"`
	Title                    string  `json:"title"`
	FullSeason               bool    `json:"fullSeason"`
	SceneSource              bool    `json:"sceneSource"`
	SeasonNumber             int     `json:"seasonNumber"`
	Languages                []any   `json:"languages"`
	MappedSeriesID           int     `json:"mappedSeriesId,omitempty"`
	MappedMovieID            int     `json:"mappedMovieId,omitempty"`
	Approved                 bool    `json:"approved"`
	TemporarilyRejected      bool    `json:"temporarilyRejected"`
	Rejected                 bool    `json:"rejected"`
	Rejections               []any   `json:"rejections"`
	PublishDate              string  `json:"publishDate"`
	CommentURL               string  `json:"commentUrl"`
	DownloadURL              string  `json:"downloadUrl"`
	InfoURL                  string  `json:"infoUrl"`
	DownloadAllowed          bool    `json:"downloadAllowed"`
	ReleaseWeight            int     `json:"releaseWeight"`
	Seeders                  int     `json:"seeders"`
	Leechers                 int     `json:"leechers"`
	Protocol                 string  `json:"protocol"`
	IsDaily                  bool    `json:"isDaily"`
	IsAbsoluteNumbering      bool    `json:"isAbsoluteNumbering"`
	IsPossibleSpecialEpisode bool    `json:"isPossibleSpecialEpisode"`
	Special                  bool    `json:"special"`
}

ReleaseResource represents a release found during a search.

type RemotePathMappingResource added in v1.1.0

type RemotePathMappingResource struct {
	ID         int    `json:"id"`
	Host       string `json:"host"`
	RemotePath string `json:"remotePath"`
	LocalPath  string `json:"localPath"`
}

RemotePathMappingResource maps a remote host's path to a local path.

type RenameEpisodeResource added in v1.1.0

type RenameEpisodeResource struct {
	EpisodeID      int    `json:"episodeId"`
	SeasonNumber   int    `json:"seasonNumber"`
	EpisodeNumbers []int  `json:"episodeNumbers"`
	ExistingPath   string `json:"existingPath"`
	NewPath        string `json:"newPath"`
}

RenameEpisodeResource represents a proposed file rename.

type RenameMovieResource added in v1.1.0

type RenameMovieResource struct {
	MovieID      int    `json:"movieId"`
	MovieFileID  int    `json:"movieFileId"`
	ExistingPath string `json:"existingPath"`
	NewPath      string `json:"newPath"`
}

RenameMovieResource represents a proposed movie file rename.

type RootFolder

type RootFolder struct {
	ID              int              `json:"id"`
	Path            string           `json:"path"`
	Accessible      bool             `json:"accessible"`
	FreeSpace       int64            `json:"freeSpace"`
	UnmappedFolders []UnmappedFolder `json:"unmappedFolders"`
}

RootFolder represents a configured root folder in an *arr application.

type SelectOption added in v1.1.0

type SelectOption struct {
	Value int    `json:"value"`
	Name  string `json:"name"`
	Order int    `json:"order"`
	Hint  string `json:"hint,omitempty"`
}

SelectOption is a choice inside a ProviderField of type "select".

type StatusMessage

type StatusMessage struct {
	Title    string   `json:"title"`
	Messages []string `json:"messages"`
}

StatusMessage is an embedded status note inside a queue record.

type StatusResponse

type StatusResponse struct {
	AppName                string `json:"appName"`
	InstanceName           string `json:"instanceName"`
	Version                string `json:"version"`
	BuildTime              string `json:"buildTime"`
	IsDebug                bool   `json:"isDebug"`
	IsProduction           bool   `json:"isProduction"`
	IsAdmin                bool   `json:"isAdmin"`
	IsUserInteractive      bool   `json:"isUserInteractive"`
	StartupPath            string `json:"startupPath"`
	AppData                string `json:"appData"`
	OsName                 string `json:"osName"`
	OsVersion              string `json:"osVersion"`
	IsMonoRuntime          bool   `json:"isMonoRuntime"`
	IsMono                 bool   `json:"isMono"`
	IsLinux                bool   `json:"isLinux"`
	IsOsx                  bool   `json:"isOsx"`
	IsWindows              bool   `json:"isWindows"`
	IsDocker               bool   `json:"isDocker"`
	Branch                 string `json:"branch"`
	Authentication         string `json:"authentication"`
	SqliteVersion          string `json:"sqliteVersion"`
	MigrationVersion       int    `json:"migrationVersion"`
	URLBase                string `json:"urlBase"`
	RuntimeVersion         string `json:"runtimeVersion"`
	RuntimeName            string `json:"runtimeName"`
	StartTime              string `json:"startTime"`
	PackageVersion         string `json:"packageVersion"`
	PackageAuthor          string `json:"packageAuthor"`
	PackageUpdateMechanism string `json:"packageUpdateMechanism"`
}

StatusResponse holds the system status returned by /api/v3/system/status.

type SystemRouteResource added in v1.1.0

type SystemRouteResource struct {
	Path     string `json:"path"`
	Method   string `json:"httpMethod"`
	IsPublic bool   `json:"isPublic"`
	IsDebug  bool   `json:"isDebug"`
}

SystemRouteResource describes an API route.

type Tag

type Tag struct {
	ID    int    `json:"id"`
	Label string `json:"label"`
}

Tag is a simple label used for organizing items in *arr applications.

type TagDetail added in v1.1.0

type TagDetail struct {
	ID    int    `json:"id"`
	Label string `json:"label"`

	DelayProfileIDs   []int `json:"delayProfileIds"`
	ImportListIDs     []int `json:"importListIds"`
	NotificationIDs   []int `json:"notificationIds"`
	RestrictionIDs    []int `json:"restrictionIds"`
	IndexerIDs        []int `json:"indexerIds"`
	DownloadClientIDs []int `json:"downloadClientIds"`
	AutoTagIDs        []int `json:"autoTagIds"`
	SeriesIDs         []int `json:"seriesIds,omitempty"` // Sonarr
	MovieIDs          []int `json:"movieIds,omitempty"`  // Radarr
	ArtistIDs         []int `json:"artistIds,omitempty"` // Lidarr
	AuthorIDs         []int `json:"authorIds,omitempty"` // Readarr
}

TagDetail extends a Tag with lists of IDs that use it.

type TaskResource added in v1.1.0

type TaskResource struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	TaskName      string `json:"taskName"`
	Interval      int    `json:"interval"`
	LastExecution string `json:"lastExecution"`
	LastStartTime string `json:"lastStartTime"`
	NextExecution string `json:"nextExecution"`
	LastDuration  string `json:"lastDuration"`
}

TaskResource represents a scheduled task.

type UIConfigResource added in v1.1.0

type UIConfigResource struct {
	ID                       int    `json:"id"`
	FirstDayOfWeek           int    `json:"firstDayOfWeek"`
	CalendarWeekColumnHeader string `json:"calendarWeekColumnHeader"`
	ShortDateFormat          string `json:"shortDateFormat"`
	LongDateFormat           string `json:"longDateFormat"`
	TimeFormat               string `json:"timeFormat"`
	ShowRelativeDates        bool   `json:"showRelativeDates"`
	EnableColorImpairedMode  bool   `json:"enableColorImpairedMode"`
	Theme                    string `json:"theme"`
	UILanguage               int    `json:"uiLanguage"`
	MovieInfoLanguage        int    `json:"movieInfoLanguage,omitempty"`
	MovieRuntimeFormat       string `json:"movieRuntimeFormat,omitempty"`
}

UIConfigResource holds UI settings.

type UnmappedFolder

type UnmappedFolder struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

UnmappedFolder represents a folder not yet mapped to a root folder.

type UpdateResource added in v1.1.0

type UpdateResource struct {
	ID          int    `json:"id"`
	Version     string `json:"version"`
	Branch      string `json:"branch"`
	ReleaseDate string `json:"releaseDate"`
	FileName    string `json:"fileName"`
	URL         string `json:"url"`
	Installed   bool   `json:"installed"`
	InstalledOn string `json:"installedOn,omitempty"`
	Installable bool   `json:"installable"`
	Latest      bool   `json:"latest"`
	Changes     any    `json:"changes"`
	Hash        string `json:"hash"`
}

UpdateResource represents an available application update.

Directories

Path Synopsis
autobrr module
bazarr module
flaresolverr module
jackett module
lidarr module
mylar module
nzbhydra module
prowlarr module
radarr module
readarr module
seerr module
sonarr module
whisparr module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL