Documentation
¶
Overview ¶
Package importer moves completed downloads into the library directory tree, creates movie_file records, and updates movie status.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service subscribes to TypeDownloadDone events and imports completed files into the library directory tree.
func NewService ¶
func NewService(q dbgen.Querier, bus *events.Bus, logger *slog.Logger, mm *mediamanagement.Service, dh *downloadhandling.Service, mediaSvc *mediainfo.Service, sqlDB ...*sql.DB) *Service
NewService creates a new Service.
func (*Service) ImportFromHaulRecord ¶
ImportFromHaulRecord runs the import pipeline against a Haul history record without requiring a pre-existing Prism grab_history row. Used by the "import from Haul" flow on the movie detail page and the Activity-page "downloaded but not in library" rail — surfaces files Haul has but Prism's library doesn't know about (because the original grab record was lost, the torrent was added directly in Haul, or the file pre-dates the importer).
movieID is the target movie in Prism's DB; contentPath is the absolute path Haul reports as save_path/name. Quality + edition are zero-valued (importer derives what it can from filename when the grab is empty).