arrs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathMatchFailed         = model.ErrPathMatchFailed
	ErrEpisodeAlreadySatisfied = model.ErrEpisodeAlreadySatisfied
	ErrInstanceNotFound        = model.ErrInstanceNotFound
)

Functions

This section is empty.

Types

type ConfigInstance

type ConfigInstance = model.ConfigInstance

Re-export types for backward compatibility

type ConfigManager

type ConfigManager = model.ConfigManager

type Service

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

Service manages Radarr and Sonarr instances for health monitoring and file repair

func NewService

func NewService(configGetter config.ConfigGetter, configManager model.ConfigManager, userRepo *database.UserRepository, queueRepo *database.Repository) *Service

NewService creates a new arrs service for health monitoring and file repair

func (*Service) CleanupQueue

func (s *Service) CleanupQueue(ctx context.Context) error

CleanupQueue checks all ARR instances for importPending items with empty folders

func (*Service) EnsureDownloadClientRegistration

func (s *Service) EnsureDownloadClientRegistration(ctx context.Context, altmountHost string, altmountPort int, urlBase string, apiKey string) error

EnsureDownloadClientRegistration ensures that AltMount is registered as a SABnzbd download client in all enabled ARR instances

func (*Service) EnsureWebhookRegistration

func (s *Service) EnsureWebhookRegistration(ctx context.Context, altmountURL string, apiKey string) error

EnsureWebhookRegistration ensures that the AltMount webhook is registered in all enabled ARR instances

func (*Service) GetAllInstances

func (s *Service) GetAllInstances() []*model.ConfigInstance

GetAllInstances returns all arrs instances from configuration

func (*Service) GetFirstAdminAPIKey

func (s *Service) GetFirstAdminAPIKey(ctx context.Context) string

GetFirstAdminAPIKey retrieves the API key of the first admin user

func (*Service) GetHealth

func (s *Service) GetHealth(ctx context.Context) (map[string]any, error)

GetHealth retrieves health checks from all enabled ARR instances

func (*Service) GetInstance

func (s *Service) GetInstance(instanceType, instanceName string) *model.ConfigInstance

GetInstance returns a specific instance by type and name

func (*Service) RegisterInstance

func (s *Service) RegisterInstance(ctx context.Context, arrURL, apiKey string) error

RegisterInstance attempts to automatically register an ARR instance

func (*Service) StartWorker

func (s *Service) StartWorker(ctx context.Context) error

StartWorker starts the queue cleanup worker

func (*Service) StopWorker

func (s *Service) StopWorker(ctx context.Context)

StopWorker stops the queue cleanup worker

func (*Service) TestConnection

func (s *Service) TestConnection(ctx context.Context, instanceType, url, apiKey string) error

TestConnection tests the connection to an arrs instance

func (*Service) TestDownloadClientRegistration

func (s *Service) TestDownloadClientRegistration(ctx context.Context, altmountHost string, altmountPort int, urlBase string, apiKey string) (map[string]string, error)

TestDownloadClientRegistration tests the connection from ARR instances back to AltMount

func (*Service) TriggerDownloadScan

func (s *Service) TriggerDownloadScan(ctx context.Context, instanceType string)

TriggerDownloadScan triggers the "Check For Finished Downloads" task in ARR instances

func (*Service) TriggerFileRescan

func (s *Service) TriggerFileRescan(ctx context.Context, pathForRescan string, relativePath string) error

TriggerFileRescan triggers a rescan for a specific file path through the appropriate ARR instance

func (*Service) TriggerScanForFile

func (s *Service) TriggerScanForFile(ctx context.Context, filePath string) error

TriggerScanForFile finds the ARR instance managing the file and triggers a download scan on it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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