unmapped

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("unmapped folder not found")

ErrNotFound is returned for an unknown folder id.

Functions

func FolderTitle

func FolderTitle(name string) (string, int)

FolderTitle turns a folder name into a show title and year for a TMDB search: "Show.Name.(2019).1080p" → ("Show Name", 2019).

func SkipFolder

func SkipFolder(name string) bool

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 New

func New(q db.Querier, shows Shows) *Service

New creates a Service.

func (*Service) Add

func (s *Service) Add(ctx context.Context, id string, req AddRequest) (show.Series, error)

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

func (s *Service) Discover(ctx context.Context, libraryID, root string) error

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.

func (*Service) List

func (s *Service) List(ctx context.Context, includeIgnored bool) ([]Folder, error)

List returns the unmapped folders, without ignored ones unless asked.

func (*Service) SetIgnored

func (s *Service) SetIgnored(ctx context.Context, id string, ignored bool) error

SetIgnored ignores a folder (or stops ignoring it).

type Shows

type Shows interface {
	Lookup(ctx context.Context, req show.LookupRequest) ([]tmdbtv.SearchResult, error)
	Add(ctx context.Context, req show.AddRequest) (show.Series, error)
}

Shows is the part of show.Service this package uses.

Jump to

Keyboard shortcuts

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