Documentation
¶
Overview ¶
Package unmapped tracks folders in a library root that no series in Pilot claims, so the user can review them (Sonarr's library import).
The library scan used to auto-add a series for each such folder from its best TMDB search hit, without asking; a wrong hit added the wrong show and attached files to it. Now Discover records the folder with that best hit as a guess, and nothing is added until the user confirms it (Add, possibly with a different show) or ignores the folder.
Index ¶
- Variables
- func FolderTitle(name string) (string, int)
- func SkipFolder(name string) bool
- type AddRequest
- type Folder
- type Service
- func (s *Service) Add(ctx context.Context, id string, req AddRequest) (show.Series, error)
- func (s *Service) Discover(ctx context.Context, libraryID, root string) error
- func (s *Service) List(ctx context.Context, includeIgnored bool) ([]Folder, error)
- func (s *Service) SetIgnored(ctx context.Context, id string, ignored bool) error
- type Shows
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("unmapped folder not found")
ErrNotFound is returned for an unknown folder id.
Functions ¶
func FolderTitle ¶
FolderTitle turns a folder name into a show title and year for a TMDB search: "Show.Name.(2019).1080p" → ("Show Name", 2019).
func SkipFolder ¶
SkipFolder reports whether a folder in a library is not a show and is never scanned: "_unsorted" (files set aside by hand because they could not be identified), NAS system folders, and hidden folders. Used by the library scan too.
Types ¶
type AddRequest ¶
type AddRequest struct {
TMDBID int // 0 = the guess
QualityProfileID string // "" = the library's default
MonitorType string // "" = "existing"
}
AddRequest confirms a folder as a series.
type Folder ¶
type Folder struct {
ID string
LibraryID string
Path string
Name string
GuessTMDBID int
GuessTitle string
GuessYear int
GuessPosterPath string
Ignored bool
FirstSeenAt string
}
Folder is one unmapped folder.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service records and resolves unmapped folders.
func (*Service) Add ¶
Add adds the series for a folder (the guess, or another TMDB id), points the series at the folder so its files are found there, and removes the record.
func (*Service) Discover ¶
Discover reads the top-level folders of a library root and records each one no series claims, with a TMDB guess. Folders already recorded are not looked up again. Records whose folder is gone, or that a series now claims, are removed. It adds no series.