arr

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFilePaths

func ExtractFilePaths(payload WebhookPayload) []string

ExtractFilePaths returns the final library file paths from a webhook payload. Returns nil when EventType is not "Download" — arr fires this event only after the file has been renamed and moved to its final library destination.

func RemoveWebhook

func RemoveWebhook(ctx context.Context, instance config.ArrInstance) error

RemoveWebhook deletes the Postie notification from the arr app using the stored WebhookID. No-op if WebhookID is 0.

func SetupWebhook

func SetupWebhook(ctx context.Context, instance config.ArrInstance, webhookURL string) (int64, error)

SetupWebhook registers a Postie webhook notification with the target *arr app using its native API. Returns the notification ID created in the arr app, which must be saved to ArrInstance.WebhookID for later removal. webhookURL must be the full Postie URL including the ?apiKey query param.

func TestConnection

func TestConnection(ctx context.Context, instance config.ArrInstance) error

TestConnection verifies the arr instance is reachable and the API key is valid.

Types

type BookFilePayload

type BookFilePayload struct {
	Path string `json:"path"`
}

type EpisodeFilePayload

type EpisodeFilePayload struct {
	Path string `json:"path"`
}

type MovieFilePayload

type MovieFilePayload struct {
	Path string `json:"path"`
}

type TrackFilePayload

type TrackFilePayload struct {
	Path string `json:"path"`
}

type WebhookPayload

type WebhookPayload struct {
	EventType   string              `json:"eventType"`
	MovieFile   *MovieFilePayload   `json:"movieFile,omitempty"`
	EpisodeFile *EpisodeFilePayload `json:"episodeFile,omitempty"`
	TrackFiles  []TrackFilePayload  `json:"trackFiles,omitempty"`
	BookFiles   []BookFilePayload   `json:"bookFiles,omitempty"`
}

WebhookPayload is a unified struct covering the import event payloads from Radarr, Sonarr, Lidarr, and Readarr. Fields unused by a given app are nil/empty.

Jump to

Keyboard shortcuts

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