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 ¶
- type Config
- type Coordinator
- func (c *Coordinator) AttemptFallback(ctx context.Context, item *database.ImportQueueItem) error
- func (c *Coordinator) CreateSingleStrmFile(ctx context.Context, strmResultingPath, originalVirtualPath string, port int) error
- func (c *Coordinator) CreateStrmFiles(ctx context.Context, item *database.ImportQueueItem, resultingPath string) error
- func (c *Coordinator) CreateSymlinks(ctx context.Context, item *database.ImportQueueItem, resultingPath string) error
- func (c *Coordinator) HandleFailure(ctx context.Context, item *database.ImportQueueItem, processingErr error) error
- func (c *Coordinator) HandleSuccess(ctx context.Context, item *database.ImportQueueItem, resultingPath string, ...) (*ProcessingResult, error)
- func (c *Coordinator) NotifyARR(ctx context.Context, item *database.ImportQueueItem, resultingPath string) error
- func (c *Coordinator) NotifyVFS(ctx context.Context, resultingPath string, async bool)
- func (c *Coordinator) RefreshMountPathIfNeeded(ctx context.Context, resultingPath string, itemID int64)
- func (c *Coordinator) ScheduleHealthCheck(ctx context.Context, item *database.ImportQueueItem, resultingPath string, ...) error
- func (c *Coordinator) SetArrsService(service *arrs.Service)
- func (c *Coordinator) SetRcloneClient(client rclonecli.RcloneRcClient)
- type ProcessingResult
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 (*Coordinator) CreateSymlinks ¶
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, processingErr error) error
HandleFailure performs cleanup and fallback for failed imports
func (*Coordinator) HandleSuccess ¶
func (c *Coordinator) HandleSuccess(ctx context.Context, item *database.ImportQueueItem, resultingPath string, writtenPaths []string) (*ProcessingResult, error)
HandleSuccess performs all post-processing for successful imports. writtenPaths lists every virtual file the import wrote (nil falls back to resultingPath); multi-file imports (season packs) get a per-file health check.
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, item *database.ImportQueueItem, resultingPath string, writtenPaths []string) error
ScheduleHealthCheck schedules an immediate health check for an imported file. Multi-file imports (e.g. season packs) schedule one check per written virtual file — resultingPath is a directory there, so the per-file paths are the only way each episode gets verified right after import and a partially-dead pack surfaces immediately. Single-file imports keep the old behavior (one check on resultingPath).
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)