nfo

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: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTitle          = errors.New("no title found")
	ErrMultipleTitles   = errors.New("multiple titles found")
	ErrNoWidth          = errors.New("no width found")
	ErrMultipleWidths   = errors.New("multiple widths found")
	ErrInvalidWidth     = errors.New("invalid width, must be a positive integer")
	ErrNoHeight         = errors.New("no height found")
	ErrMultipleHeights  = errors.New("multiple heights found")
	ErrInvalidHeight    = errors.New("invalid height, must be a positive integer")
	ErrMultipleEditions = errors.New("multiple editions found")
)
View Source
var (
	ErrBadXml           = errors.New("invalid xml")
	ErrBadRootNamespace = errors.New("root tag namespace should be empty")
	ErrBadRootTag       = errors.New("unexpected root tag")
)

Functions

func WriteTo

func WriteTo(nfo Nfo, out io.Writer) error

WriteTo writes the NFO document to the given writer.

Types

type Episode

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

func (*Episode) Height

func (wd *Episode) Height() int

func (*Episode) SetTitle

func (wt *Episode) SetTitle(title string)

func (*Episode) Title

func (wt *Episode) Title() string

func (*Episode) Width

func (wd *Episode) Width() int

type Movie

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

func (*Movie) Edition added in v0.4.4

func (we *Movie) Edition() (string, bool)

func (*Movie) Genres

func (wg *Movie) Genres() iter.Seq[string]

func (*Movie) Height

func (wd *Movie) Height() int

func (*Movie) SetTitle

func (wt *Movie) SetTitle(title string)

func (*Movie) Tags

func (wt *Movie) Tags() iter.Seq[string]

func (*Movie) Title

func (wt *Movie) Title() string

func (*Movie) Width

func (wd *Movie) Width() int

type Nfo

type Nfo interface {
	// contains filtered or unexported methods
}

Nfo will always be an instance of *Movie, *TvShow, or *Episode.

func ReadFrom

func ReadFrom(in io.Reader) (Nfo, error)

ReadFrom reads an NFO file from the given reader and returns the parsed data.

type TvShow

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

func (*TvShow) Genres

func (wg *TvShow) Genres() iter.Seq[string]

func (*TvShow) SetTitle

func (wt *TvShow) SetTitle(title string)

func (*TvShow) Tags

func (wt *TvShow) Tags() iter.Seq[string]

func (*TvShow) Title

func (wt *TvShow) Title() string

type WithDimensions

type WithDimensions interface {
	Nfo
	Width() int
	Height() int
}

An NFO file with dimensions.

type WithEdition added in v0.4.4

type WithEdition interface {
	Nfo
	Edition() (string, bool)
}

An NFO file that (optionally) contains an edition.

type WithGeneres

type WithGeneres interface {
	Nfo
	Genres() iter.Seq[string]
}

An NFO file with genres.

type WithTags

type WithTags interface {
	Nfo
	Tags() iter.Seq[string]
}

An NFO file with tags.

type WithTitle

type WithTitle interface {
	Nfo

	Title() string
	SetTitle(title string)
}

An NFO file with a title.

Jump to

Keyboard shortcuts

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