Documentation
¶
Overview ¶
Package importer runs the post-download pipeline: find media file, apply naming template, transfer to library, update DB, refresh media servers. Fed by internal/jobs/download_monitor (event-fast path) and by the import_scan scheduler job (restart-safe path).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPathNotAllowed = errors.New("save_path not in allowed download roots")
ErrPathNotAllowed is returned when a DownloadRecord.save_path is not within any configured Library.AllowedDownloadRoots prefix.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
DB db.Store
Library *library.ImportService
Download download.Downloader
MediaServer MediaServerDispatcher
}
Deps is worker wiring. User-facing knobs (max attempts, keep seeding, allowed roots, movie library path) are read via config.Get() inside runImport.
type Enqueuer ¶
type Enqueuer interface {
Enqueue(recordID uint32)
}
Enqueuer is the consumer-facing queue surface. download_monitor accepts it so it can be driven by a fake in tests without pulling in the full Worker.
type MediaServerDispatcher ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) Enqueue ¶
Enqueue pushes a record ID into the import queue. Non-blocking: when the queue is full the ID is dropped (import_scan will pick it up on the next tick). Dedupe: IDs already in-flight are dropped.