prowlarr

package
v0.0.0-...-f30bd74 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const APIver = "v1"

APIver is the Prowlarr API version supported by this library.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInput

type ApplicationInput struct {
	ID                 int                 `json:"id,omitempty"`
	Name               string              `json:"name"`
	Fields             []*starr.FieldInput `json:"fields"`
	ImplementationName string              `json:"implementationName"`
	Implementation     string              `json:"implementation"`
	ConfigContract     string              `json:"configContract"`
	InfoLink           string              `json:"infoLink"`
	SyncLevel          string              `json:"syncLevel"`
	Tags               []int               `json:"tags"`
}

type ApplicationOutput

type ApplicationOutput struct {
	ID                 int                  `json:"id"`
	Name               string               `json:"name"`
	Fields             []*starr.FieldOutput `json:"fields"`
	ImplementationName string               `json:"implementationName"`
	Implementation     string               `json:"implementation"`
	ConfigContract     string               `json:"configContract"`
	InfoLink           string               `json:"infoLink"`
	SyncLevel          string               `json:"syncLevel"`
	Tags               []int                `json:"tags"`
}

type Capabilities

type Capabilities struct {
	SupportsRawSearch bool          `json:"supportsRawSearch"`
	LimitsMax         int64         `json:"limitsMax"`
	LimitsDefault     int64         `json:"limitsDefault"`
	SearchParams      []string      `json:"searchParams"`
	TvSearchParams    []string      `json:"tvSearchParams"`
	MovieSearchParams []string      `json:"movieSearchParams"`
	MusicSearchParams []string      `json:"musicSearchParams"`
	BookSearchParams  []string      `json:"bookSearchParams"`
	Categories        []*Categories `json:"categories"`
}

Capabilities is part of IndexerOutput.

type Categories

type Categories struct {
	ID            int64         `json:"id"`
	Name          string        `json:"name"`
	SubCategories []*Categories `json:"subCategories"`
}

Categories is part of Capabilities.

type Category

type Category struct {
	ID            int64       `json:"id"`
	Name          string      `json:"name"`
	SubCategories []*Category `json:"subCategories"`
}

Category is part of the Search output.

type DownloadClientInput

type DownloadClientInput struct {
	Enable             bool                `json:"enable"`
	Priority           int                 `json:"priority"`
	ID                 int64               `json:"id,omitempty"`
	ConfigContract     string              `json:"configContract"`
	Implementation     string              `json:"implementation"`
	Name               string              `json:"name"`
	Protocol           starr.Protocol      `json:"protocol"`
	Tags               []int               `json:"tags"`
	Fields             []*starr.FieldInput `json:"fields"`
	Categories         []interface{}       `json:"categories"`
	SupportsCategories bool                `json:"supportsCategories"`
}

DownloadClientInput is the input for a new or updated download client.

type DownloadClientOutput

type DownloadClientOutput struct {
	Enable             bool                 `json:"enable"`
	Priority           int                  `json:"priority"`
	ID                 int64                `json:"id,omitempty"`
	ConfigContract     string               `json:"configContract"`
	Implementation     string               `json:"implementation"`
	ImplementationName string               `json:"implementationName"`
	InfoLink           string               `json:"infoLink"`
	Name               string               `json:"name"`
	Protocol           starr.Protocol       `json:"protocol"`
	Tags               []int                `json:"tags"`
	Fields             []*starr.FieldOutput `json:"fields"`
}

DownloadClientOutput is the output from the download client methods.

type IndexerInput

type IndexerInput struct {
	Enable         bool                `json:"enable"`
	Redirect       bool                `json:"redirect"`
	Priority       int64               `json:"priority"`
	ID             int64               `json:"id,omitempty"`
	AppProfileID   int64               `json:"appProfileId"`
	ConfigContract string              `json:"configContract"`
	Implementation string              `json:"implementation"`
	Name           string              `json:"name"`
	Protocol       starr.Protocol      `json:"protocol"`
	Tags           []int               `json:"tags,omitempty"`
	Fields         []*starr.FieldInput `json:"fields"`
}

IndexerInput is the input for a new or updated indexer.

type IndexerOutput

type IndexerOutput struct {
	Enable             bool                 `json:"enable"`
	Redirect           bool                 `json:"redirect"`
	SupportsRss        bool                 `json:"supportsRss"`
	SupportsSearch     bool                 `json:"supportsSearch"`
	SupportsRedirect   bool                 `json:"supportsRedirect"`
	AppProfileID       int64                `json:"appProfileId"`
	ID                 int64                `json:"id,omitempty"`
	Priority           int64                `json:"priority"`
	SortName           string               `json:"sortName"`
	Name               string               `json:"name"`
	Protocol           starr.Protocol       `json:"protocol"`
	Privacy            string               `json:"privacy"`
	DefinitionName     string               `json:"definitionName"`
	Description        string               `json:"description"`
	Language           string               `json:"language"`
	Encoding           string               `json:"encoding,omitempty"`
	ImplementationName string               `json:"implementationName"`
	Implementation     string               `json:"implementation"`
	ConfigContract     string               `json:"configContract"`
	InfoLink           string               `json:"infoLink"`
	Added              time.Time            `json:"added"`
	Capabilities       *Capabilities        `json:"capabilities,omitempty"`
	Tags               []int                `json:"tags"`
	IndexerUrls        []string             `json:"indexerUrls"`
	LegacyUrls         []string             `json:"legacyUrls"`
	Fields             []*starr.FieldOutput `json:"fields"`
}

IndexerOutput is the output from the indexer methods.

type NotificationInput

type NotificationInput struct {
	OnGrab                      bool                `json:"onGrab"`
	OnHealthIssue               bool                `json:"onHealthIssue"`
	OnHealthRestored            bool                `json:"onHealthRestored"`
	OnApplicationUpdate         bool                `json:"onApplicationUpdate"`
	SupportsOnGrab              bool                `json:"supportsOnGrab"`
	IncludeManualGrabs          bool                `json:"includeManualGrabs"`
	SupportsOnHealthIssue       bool                `json:"supportsOnHealthIssue"`
	SupportsOnHealthRestored    bool                `json:"supportsOnHealthRestored"`
	IncludeHealthWarnings       bool                `json:"includeHealthWarnings"`
	SupportsOnApplicationUpdate bool                `json:"supportsOnApplicationUpdate"`
	ID                          int64               `json:"id,omitempty"` // update only
	Name                        string              `json:"name"`
	ImplementationName          string              `json:"implementationName"`
	Implementation              string              `json:"implementation"`
	ConfigContract              string              `json:"configContract"`
	InfoLink                    string              `json:"infoLink"`
	Tags                        []int               `json:"tags"`
	Fields                      []*starr.FieldInput `json:"fields"`
}

NotificationInput is the input for a new or updated notification.

type NotificationOutput

type NotificationOutput struct {
	OnGrab                      bool                 `json:"onGrab"`
	OnHealthIssue               bool                 `json:"onHealthIssue"`
	OnHealthRestored            bool                 `json:"onHealthRestored"`
	OnApplicationUpdate         bool                 `json:"onApplicationUpdate"`
	SupportsOnGrab              bool                 `json:"supportsOnGrab"`
	IncludeManualGrabs          bool                 `json:"includeManualGrabs"`
	SupportsOnHealthIssue       bool                 `json:"supportsOnHealthIssue"`
	SupportsOnHealthRestored    bool                 `json:"supportsOnHealthRestored"`
	IncludeHealthWarnings       bool                 `json:"includeHealthWarnings"`
	SupportsOnApplicationUpdate bool                 `json:"supportsOnApplicationUpdate"`
	ID                          int64                `json:"id"`
	Name                        string               `json:"name"`
	ImplementationName          string               `json:"implementationName"`
	Implementation              string               `json:"implementation"`
	ConfigContract              string               `json:"configContract"`
	InfoLink                    string               `json:"infoLink"`
	Tags                        []int                `json:"tags"`
	Fields                      []*starr.FieldOutput `json:"fields"`
	Message                     struct {
		Message string `json:"message"` // this is a weird place for a message
		Type    string `json:"type"`
	} `json:"message"`
}

NotificationOutput is the output from the notification methods.

type Prowlarr

type Prowlarr struct {
	starr.APIer
}

Prowlarr contains all the methods to interact with a Prowlarr server.

func New

func New(config *starr.Config) *Prowlarr

New returns a Prowlarr object used to interact with the Prowlarr API.

func (*Prowlarr) AddApplication

func (p *Prowlarr) AddApplication(application *ApplicationInput) (*ApplicationOutput, error)

AddDownloadClient creates a download client without testing it.

func (*Prowlarr) AddApplicationContext

func (p *Prowlarr) AddApplicationContext(ctx context.Context,
	client *ApplicationInput,
) (*ApplicationOutput, error)

AddDownloadClientContext creates a download client without testing it.

func (*Prowlarr) AddDownloadClient

func (p *Prowlarr) AddDownloadClient(downloadclient *DownloadClientInput) (*DownloadClientOutput, error)

AddDownloadClient creates a download client without testing it.

func (*Prowlarr) AddDownloadClientContext

func (p *Prowlarr) AddDownloadClientContext(ctx context.Context,
	client *DownloadClientInput,
) (*DownloadClientOutput, error)

AddDownloadClientContext creates a download client without testing it.

func (*Prowlarr) AddIndexer

func (p *Prowlarr) AddIndexer(indexer *IndexerInput) (*IndexerOutput, error)

AddIndexer creates an indexer without testing it.

func (*Prowlarr) AddIndexerContext

func (p *Prowlarr) AddIndexerContext(ctx context.Context, indexer *IndexerInput) (*IndexerOutput, error)

AddIndexerContext creates an indexer without testing it.

func (*Prowlarr) AddNotification

func (p *Prowlarr) AddNotification(notification *NotificationInput) (*NotificationOutput, error)

AddNotification creates a notification.

func (*Prowlarr) AddNotificationContext

func (p *Prowlarr) AddNotificationContext(ctx context.Context, client *NotificationInput) (*NotificationOutput, error)

AddNotificationContext creates a notification.

func (*Prowlarr) AddTag

func (p *Prowlarr) AddTag(tag *starr.Tag) (*starr.Tag, error)

AddTag creates a tag.

func (*Prowlarr) AddTagContext

func (p *Prowlarr) AddTagContext(ctx context.Context, tag *starr.Tag) (*starr.Tag, error)

AddTagContext creates a tag.

func (*Prowlarr) DeleteApplication

func (p *Prowlarr) DeleteApplication(applicationID int64) error

func (*Prowlarr) DeleteApplicationContext

func (p *Prowlarr) DeleteApplicationContext(ctx context.Context, applicationID int64) error

func (*Prowlarr) DeleteDownloadClient

func (p *Prowlarr) DeleteDownloadClient(downloadclientID int64) error

DeleteDownloadClient removes a single download client.

func (*Prowlarr) DeleteDownloadClientContext

func (p *Prowlarr) DeleteDownloadClientContext(ctx context.Context, downloadclientID int64) error

DeleteDownloadClientContext removes a single download client.

func (*Prowlarr) DeleteIndexer

func (p *Prowlarr) DeleteIndexer(indexerID int64) error

DeleteIndexer removes a single indexer.

func (*Prowlarr) DeleteIndexerContext

func (p *Prowlarr) DeleteIndexerContext(ctx context.Context, indexerID int64) error

DeleteIndexerContext removes a single indexer.

func (*Prowlarr) DeleteNotification

func (p *Prowlarr) DeleteNotification(notificationID int64) error

DeleteNotification removes a single notification.

func (*Prowlarr) DeleteNotificationContext

func (p *Prowlarr) DeleteNotificationContext(ctx context.Context, notificationID int64) error

func (*Prowlarr) DeleteTag

func (p *Prowlarr) DeleteTag(tagID int) error

DeleteTag removes a single tag.

func (*Prowlarr) DeleteTagContext

func (p *Prowlarr) DeleteTagContext(ctx context.Context, tagID int) error

func (*Prowlarr) GetApplication

func (p *Prowlarr) GetApplication(applicationID int64) (*ApplicationOutput, error)

func (*Prowlarr) GetApplicationContext

func (p *Prowlarr) GetApplicationContext(ctx context.Context, clientID int64) (*ApplicationOutput, error)

func (*Prowlarr) GetApplications

func (p *Prowlarr) GetApplications() ([]*ApplicationOutput, error)

func (*Prowlarr) GetApplicationsContext

func (p *Prowlarr) GetApplicationsContext(ctx context.Context) ([]*ApplicationOutput, error)

func (*Prowlarr) GetBackupFiles

func (p *Prowlarr) GetBackupFiles() ([]*starr.BackupFile, error)

GetBackupFiles returns all available Prowlarr backup files. Use GetBody to download a file using BackupFile.Path.

func (*Prowlarr) GetBackupFilesContext

func (p *Prowlarr) GetBackupFilesContext(ctx context.Context) ([]*starr.BackupFile, error)

GetBackupFiles returns all available Prowlarr backup files. Use GetBody to download a file using BackupFile.Path.

func (*Prowlarr) GetDownloadClient

func (p *Prowlarr) GetDownloadClient(downloadclientID int64) (*DownloadClientOutput, error)

GetDownloadClient returns a single download client.

func (*Prowlarr) GetDownloadClientContext

func (p *Prowlarr) GetDownloadClientContext(ctx context.Context, clientID int64) (*DownloadClientOutput, error)

GetDownloadClientContext returns a single download client.

func (*Prowlarr) GetDownloadClients

func (p *Prowlarr) GetDownloadClients() ([]*DownloadClientOutput, error)

GetDownloadClients returns all configured download clients.

func (*Prowlarr) GetDownloadClientsContext

func (p *Prowlarr) GetDownloadClientsContext(ctx context.Context) ([]*DownloadClientOutput, error)

GetDownloadClientsContext returns all configured download clients.

func (*Prowlarr) GetIndexer

func (p *Prowlarr) GetIndexer(indexerID int64) (*IndexerOutput, error)

GetIndexer returns a single indexer.

func (*Prowlarr) GetIndexerContext

func (p *Prowlarr) GetIndexerContext(ctx context.Context, indexerID int64) (*IndexerOutput, error)

GetIndexerContext returns a single indexer.

func (*Prowlarr) GetIndexers

func (p *Prowlarr) GetIndexers() ([]*IndexerOutput, error)

GetIndexers returns all configured indexers.

func (*Prowlarr) GetIndexersContext

func (p *Prowlarr) GetIndexersContext(ctx context.Context) ([]*IndexerOutput, error)

GetIndexersContext returns all configured indexers.

func (*Prowlarr) GetNotification

func (p *Prowlarr) GetNotification(notificationID int) (*NotificationOutput, error)

GetNotification returns a single notification.

func (*Prowlarr) GetNotificationContext

func (p *Prowlarr) GetNotificationContext(ctx context.Context, notificationID int) (*NotificationOutput, error)

GetNotificationContext returns a single notification.

func (*Prowlarr) GetNotifications

func (p *Prowlarr) GetNotifications() ([]*NotificationOutput, error)

GetNotifications returns all configured notifications.

func (*Prowlarr) GetNotificationsContext

func (p *Prowlarr) GetNotificationsContext(ctx context.Context) ([]*NotificationOutput, error)

GetNotificationsContext returns all configured notifications.

func (*Prowlarr) GetSystemStatus

func (p *Prowlarr) GetSystemStatus() (*SystemStatus, error)

GetSystemStatus returns system status.

func (*Prowlarr) GetSystemStatusContext

func (p *Prowlarr) GetSystemStatusContext(ctx context.Context) (*SystemStatus, error)

GetSystemStatusContext returns system status.

func (*Prowlarr) GetTag

func (p *Prowlarr) GetTag(tagID int) (*starr.Tag, error)

GetTag returns a single tag.

func (*Prowlarr) GetTagContext

func (p *Prowlarr) GetTagContext(ctx context.Context, tagID int) (*starr.Tag, error)

GetTagContext returns a single tag.

func (*Prowlarr) GetTags

func (p *Prowlarr) GetTags() ([]*starr.Tag, error)

GetTags returns all configured tags.

func (*Prowlarr) GetTagsContext

func (p *Prowlarr) GetTagsContext(ctx context.Context) ([]*starr.Tag, error)

GetTagsContext returns all configured tags.

func (*Prowlarr) Ping

func (p *Prowlarr) Ping() error

Ping returns an error if the Prowlarr instance does not respond with a 200 to an HTTP /ping request.

func (*Prowlarr) PingContext

func (p *Prowlarr) PingContext(ctx context.Context) error

PingContext returns an error if the Prowlarr instance does not respond with a 200 to an HTTP /ping request.

func (*Prowlarr) Search

func (p *Prowlarr) Search(search SearchInput) ([]*Search, error)

Search the Prowlarr indexers for media and content. Must provide a Query in the SearchInput.

func (*Prowlarr) SearchContext

func (p *Prowlarr) SearchContext(ctx context.Context, search SearchInput) ([]*Search, error)

SearchContext searches the Prowlarr indexers for media and content.

func (*Prowlarr) TestApplication

func (p *Prowlarr) TestApplication(client *ApplicationInput) error

func (*Prowlarr) TestApplicationContext

func (p *Prowlarr) TestApplicationContext(ctx context.Context, client *ApplicationInput) error

func (*Prowlarr) TestDownloadClient

func (p *Prowlarr) TestDownloadClient(client *DownloadClientInput) error

TestDownloadClient tests a download client.

func (*Prowlarr) TestDownloadClientContext

func (p *Prowlarr) TestDownloadClientContext(ctx context.Context, client *DownloadClientInput) error

TestDownloadClientContext tests a download client.

func (*Prowlarr) TestIndexer

func (p *Prowlarr) TestIndexer(indexer *IndexerInput) error

TestIndexer tests an indexer.

func (*Prowlarr) TestIndexerContext

func (p *Prowlarr) TestIndexerContext(ctx context.Context, indexer *IndexerInput) error

TestIndexerContext tests an indexer.

func (*Prowlarr) UpdateApplication

func (p *Prowlarr) UpdateApplication(client *ApplicationInput, force bool) (*ApplicationOutput, error)

func (*Prowlarr) UpdateApplicationContext

func (p *Prowlarr) UpdateApplicationContext(ctx context.Context,
	client *ApplicationInput,
	force bool,
) (*ApplicationOutput, error)

func (*Prowlarr) UpdateDownloadClient

func (p *Prowlarr) UpdateDownloadClient(client *DownloadClientInput, force bool) (*DownloadClientOutput, error)

UpdateDownloadClient updates the download client.

func (*Prowlarr) UpdateDownloadClientContext

func (p *Prowlarr) UpdateDownloadClientContext(ctx context.Context,
	client *DownloadClientInput,
	force bool,
) (*DownloadClientOutput, error)

UpdateDownloadClientContext updates the download client.

func (*Prowlarr) UpdateIndexer

func (p *Prowlarr) UpdateIndexer(indexer *IndexerInput, force bool) (*IndexerOutput, error)

UpdateIndexer updates the indexer.

func (*Prowlarr) UpdateIndexerContext

func (p *Prowlarr) UpdateIndexerContext(
	ctx context.Context,
	indexer *IndexerInput,
	force bool,
) (*IndexerOutput, error)

UpdateIndexerContext updates the indexer.

func (*Prowlarr) UpdateNotification

func (p *Prowlarr) UpdateNotification(notification *NotificationInput) (*NotificationOutput, error)

UpdateNotification updates the notification.

func (*Prowlarr) UpdateNotificationContext

func (p *Prowlarr) UpdateNotificationContext(ctx context.Context,
	client *NotificationInput,
) (*NotificationOutput, error)

UpdateNotificationContext updates the notification.

func (*Prowlarr) UpdateTag

func (p *Prowlarr) UpdateTag(tag *starr.Tag) (*starr.Tag, error)

UpdateTag updates a tag.

func (*Prowlarr) UpdateTagContext

func (p *Prowlarr) UpdateTagContext(ctx context.Context, tag *starr.Tag) (*starr.Tag, error)

UpdateTagContext updates a tag.

type Search struct {
	GUID         string         `json:"guid"`
	Age          int64          `json:"age"`
	AgeHours     float64        `json:"ageHours"`
	AgeMinutes   float64        `json:"ageMinutes"`
	Size         int64          `json:"size"`
	Files        int            `json:"files"`
	Grabs        int            `json:"grabs"`
	IndexerID    int64          `json:"indexerId"`
	Indexer      string         `json:"indexer"`
	Title        string         `json:"title"`
	SortTitle    string         `json:"sortTitle"`
	ImdbID       int64          `json:"imdbId"`
	TmdbID       int64          `json:"tmdbId"`
	TvdbID       int64          `json:"tvdbId"`
	TvMazeID     int64          `json:"tvMazeId"`
	PublishDate  time.Time      `json:"publishDate"`
	CommentURL   string         `json:"commentUrl"`
	DownloadURL  string         `json:"downloadUrl"`
	InfoURL      string         `json:"infoUrl"`
	IndexerFlags []string       `json:"indexerFlags"`
	Categories   []*Category    `json:"categories"`
	Protocol     starr.Protocol `json:"protocol"`
	FileName     string         `json:"fileName"`
	InfoHash     string         `json:"infoHash"`
	Seeders      int            `json:"seeders"`
	Leechers     int            `json:"leechers"`
}

Search is the output from the Prowlarr search endpoint.

type SearchInput

type SearchInput struct {
	Query      string  `json:"query"` // Query is required. Fill it in.
	Type       string  `json:"type"`  // defaults to "search" if left empty
	IndexerIDs []int64 `json:"indexerIds"`
	Categories []int64 `json:"categories"`
	Limit      int     `json:"limit"`  // Defaults to 100 if left empty or less than 1.
	Offset     int     `json:"offset"` // Skip this many records.
}

SearchInput is the input to the search endpoint.

type SystemStatus

type SystemStatus struct {
	AppData                string    `json:"appData"`
	AppName                string    `json:"appName"`
	Authentication         string    `json:"authentication"`
	Branch                 string    `json:"branch"`
	BuildTime              time.Time `json:"buildTime"`
	DatabaseType           string    `json:"databaseType"`
	DatabaseVersion        string    `json:"databaseVersion"`
	InstanceName           string    `json:"instanceName"`
	IsAdmin                bool      `json:"isAdmin"`
	IsDebug                bool      `json:"isDebug"`
	IsDocker               bool      `json:"isDocker"`
	IsLinux                bool      `json:"isLinux"`
	IsMono                 bool      `json:"isMono"`
	IsNetCore              bool      `json:"isNetCore"`
	IsOsx                  bool      `json:"isOsx"`
	IsProduction           bool      `json:"isProduction"`
	IsUserInteractive      bool      `json:"isUserInteractive"`
	IsWindows              bool      `json:"isWindows"`
	MigrationVersion       int64     `json:"migrationVersion"`
	Mode                   string    `json:"mode"`
	OsName                 string    `json:"osName"`
	OsVersion              string    `json:"osVersion"`
	PackageAuthor          string    `json:"packageAuthor"`
	PackageUpdateMechanism string    `json:"packageUpdateMechanism"`
	PackageVersion         string    `json:"packageVersion"`
	RuntimeName            string    `json:"runtimeName"`
	RuntimeVersion         string    `json:"runtimeVersion"`
	StartTime              time.Time `json:"startTime"`
	StartupPath            string    `json:"startupPath"`
	URLBase                string    `json:"urlBase"`
	Version                string    `json:"version"`
}

SystemStatus is the /api/v1/system/status endpoint.

Jump to

Keyboard shortcuts

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