video

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFileInfo

func BuildFileInfo(ctx context.Context, files <-chan filesystem.DirEntry) <-chan *FileInfo

BuildFileInfo reads from the given channel of filesystem.DirEntry objects, groups presence info for .mkv, .nfo, and .tcprofile files together, and produces a channel of FileInfo objects.

Types

type DirKind added in v0.3.1

type DirKind int

DirKind is an enum used to represent the type of video files in a given directory: either a movie or a tv show. DirKind implements the json.Marshaler and json.Unmarshaler interfaces, so human-readable names will be used when serializing to JSON.

const (
	DirKindMovie DirKind = iota
	DirKindShow
)

func GetDirKind added in v0.3.1

func GetDirKind(dir string) (DirKind, error)

Examines metadata under dir to determine if it is a movie or a TV show.

func (DirKind) MarshalJSON added in v0.3.2

func (dk DirKind) MarshalJSON() ([]byte, error)

func (*DirKind) UnmarshalJSON added in v0.3.2

func (dk *DirKind) UnmarshalJSON(data []byte) error

type FileInfo

type FileInfo struct {
	MkvPath      string
	HasNfo       bool
	HasTcProfile bool
}

FileInfo contains information about .mkv file that exists on-disk, as well as the presence of related .nfo and .tcprofile files.

type Paths

type Paths struct {
	// contains filtered or unexported fields
}

Paths is used to convert between different file types. See the NewPathsFrom* functions.

func NewPathsFromMkv

func NewPathsFromMkv(mkv string) *Paths

Returns an instance of the Paths type based on the given .mkv file path.

func NewPathsFromNfo

func NewPathsFromNfo(nfo string) *Paths

Returns an instance of the Paths type based on the given .nfo file path.

func NewPathsFromTcProfile

func NewPathsFromTcProfile(tcProfile string) *Paths

Returns an instance of the Paths type based on the given .tcprofile file path.

func (*Paths) Mkv

func (p *Paths) Mkv() string

func (*Paths) Nfo

func (p *Paths) Nfo() string

func (*Paths) TcProfile

func (p *Paths) TcProfile() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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