postprocessor

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: 20 Imported by: 0

Documentation

Overview

Package postprocessor handles all post-import processing steps including symlink creation, STRM file generation, VFS notifications, health check scheduling, and ARR notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigGetter    config.ConfigGetter
	MetadataService *metadata.MetadataService
	RcloneClient    rclonecli.RcloneRcClient
	HealthRepo      *database.HealthRepository
	ArrsService     *arrs.Service
	UserRepo        *database.UserRepository
}

Config holds configuration for the Coordinator

type Coordinator

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

Coordinator orchestrates all post-import processing steps

func NewCoordinator

func NewCoordinator(cfg Config) *Coordinator

NewCoordinator creates a new post-processor coordinator

func (*Coordinator) AttemptFallback

func (c *Coordinator) AttemptFallback(ctx context.Context, item *database.ImportQueueItem) error

AttemptFallback tries to send a failed import to external SABnzbd

func (*Coordinator) CreateSingleStrmFile

func (c *Coordinator) CreateSingleStrmFile(ctx context.Context, strmResultingPath, originalVirtualPath string, port int) error

CreateSingleStrmFile creates a STRM file for a single file with authentication

func (*Coordinator) CreateStrmFiles

func (c *Coordinator) CreateStrmFiles(ctx context.Context, item *database.ImportQueueItem, resultingPath string) error

CreateStrmFiles creates STRM files for an imported file or directory

func (c *Coordinator) CreateSymlinks(ctx context.Context, item *database.ImportQueueItem, resultingPath string) error

CreateSymlinks creates symlinks for an imported item based on the import strategy

func (*Coordinator) HandleFailure

func (c *Coordinator) HandleFailure(ctx context.Context, item *database.ImportQueueItem, _ error) error

HandleFailure performs cleanup and fallback for failed imports

func (c *Coordinator) HandleIDMetadataLinks(ctx context.Context, item *database.ImportQueueItem, resultingPath string)

HandleIDMetadataLinks creates ID-based metadata links for nzbdav compatibility

func (*Coordinator) HandleSuccess

func (c *Coordinator) HandleSuccess(ctx context.Context, item *database.ImportQueueItem, resultingPath string) (*ProcessingResult, error)

HandleSuccess performs all post-processing for successful imports

func (*Coordinator) NotifyARR

func (c *Coordinator) NotifyARR(ctx context.Context, item *database.ImportQueueItem, resultingPath string) error

NotifyARR notifies ARR applications about imported content

func (*Coordinator) NotifyVFS

func (c *Coordinator) NotifyVFS(ctx context.Context, resultingPath string, async bool)

NotifyVFS notifies rclone VFS about file changes

func (*Coordinator) RefreshMountPathIfNeeded

func (c *Coordinator) RefreshMountPathIfNeeded(ctx context.Context, resultingPath string, itemID int64)

RefreshMountPathIfNeeded refreshes the mount path cache if required

func (*Coordinator) ScheduleHealthCheck

func (c *Coordinator) ScheduleHealthCheck(ctx context.Context, resultingPath string) error

ScheduleHealthCheck schedules a health check for an imported file

func (*Coordinator) SetArrsService

func (c *Coordinator) SetArrsService(service *arrs.Service)

SetArrsService updates the ARRs service (called after initialization)

func (*Coordinator) SetRcloneClient

func (c *Coordinator) SetRcloneClient(client rclonecli.RcloneRcClient)

SetRcloneClient updates the rclone client (called when config changes)

type ProcessingResult

type ProcessingResult struct {
	SymlinksCreated bool
	StrmCreated     bool
	VFSNotified     bool
	HealthScheduled bool
	ARRNotified     bool
	Errors          []error
}

ProcessingResult holds the result of post-processing operations

Jump to

Keyboard shortcuts

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