nfo

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileNameCleaner

func FileNameCleaner(s string) string

FileNameCleaner return a safe file name from a given show name.

func Format2Digits

func Format2Digits(d string) string

Format2Digits return a number with 2 digits when there is only one digit

func PathNameCleaner

func PathNameCleaner(s string) string

PathNameCleaner return a safe path name from a given show name.

Types

type Actor

type Actor struct {
	Name  string `xml:"name,omitempty"`
	Role  string `xml:"role,omitempty"`
	Order string `xml:"order,omitempty"`
	Type  string `xml:"type,omitempty"`
	Thumb string `xml:"thumb,omitempty"`
}

Actor describe actors

type Aired

type Aired time.Time

Aired type helper

func (Aired) MarshalText

func (f Aired) MarshalText() ([]byte, error)

MarshalText write Aired correctly

func (Aired) Time

func (f Aired) Time() time.Time

Time convert Aired to Time

func (*Aired) UnmarshalText

func (f *Aired) UnmarshalText(text []byte) error

UnmarshalText grab aired field and turn it into time

type EpisodeDetails

type EpisodeDetails struct {
	XMLName xml.Name `xml:"episodedetails"`
	MediaInfo
}

EpisodeDetails gives details of a given episode

func (*EpisodeDetails) GetMediaInfo

func (n *EpisodeDetails) GetMediaInfo() *MediaInfo

GetMediaInfo return a pointer to MediaInfo struct

func (*EpisodeDetails) WriteNFO

func (n *EpisodeDetails) WriteNFO(destination string) error

WriteNFO file at expected place TODO remove destination and get it from show path

type ID

type ID struct {
	ID      string `xml:",chardata"`
	Type    string `xml:"type,attr,omitempty"`
	Default string `xml:"default,attr,omitempty"`
}

ID for Shows / Episode

type MediaInfo

type MediaInfo struct {
	Title          string   `xml:"title,omitempty"`
	Showtitle      string   `xml:"showtitle,omitempty"`
	Season         int      `xml:"season,omitempty"`
	Episode        int      `xml:"episode,omitempty"`
	DisplaySeason  int      `xml:"displayseason,omitempty"`
	DisplayEpisode int      `xml:"displayepisode,omitempty"`
	Plot           string   `xml:"plot,omitempty"`
	Thumb          []Thumb  `xml:"-"`
	UniqueID       []ID     `xml:"uniqueid,omitempty"`
	Genre          []string `xml:"genre,omitempty"`
	Credits        []string `xml:"credits,omitempty"`
	Director       []string `xml:"director,omitempty"`
	Aired          Aired    `xml:"aired,omitempty"`
	Studio         string   `xml:"studio,omitempty"`
	Actor          []Actor  `xml:"actor,omitempty"`
	Tag            []string `xml:"tag,omitempty"`

	MediaURL   string  `xml:"-"` // Media URL mp4
	PageURL    string  `xml:"-"` // Show page url
	IsSpecial  bool    `xml:"-"` // True when special episode
	SeasonInfo *Season `xml:"-"` // Possible Season nfo
	TVShow     *TVShow `xml:"-"` // Possible TVShow nfo
	IsDetailed bool    `xml:"-"` // True when details have been retrieved
	IsBonus    bool    `xml:"-"` // True when the media is a bonus or a teaser
	MediaType  ShowType
}

MediaInfo is the shared part of metadata

type Movie

type Movie struct {
	XMLName xml.Name `xml:"movie"`
	MediaInfo
}

Movie holds metadata for movies

func (*Movie) GetMediaInfo

func (n *Movie) GetMediaInfo() *MediaInfo

GetMediaInfo return a pointer to MediaInfo struct

func (*Movie) WriteNFO

func (n *Movie) WriteNFO(destination string) error

WriteNFO file at expected place

type Season

type Season struct {
	XMLName      xml.Name `xml:"season"`
	Plot         string   `xml:"plot,omitempty"`
	Outline      string   `xml:"outline,omitempty"`
	Lockdata     string   `xml:"lockdata,omitempty"`
	Dateadded    string   `xml:"dateadded,omitempty"`
	Title        string   `xml:"title,omitempty"`
	Year         string   `xml:"year,omitempty"`
	Aired        Aired    `xml:"premiered,omitempty"`
	Seasonnumber string   `xml:"seasonnumber,omitempty"`
	Thumb        []Thumb  `xml:"-"`
}

func (*Season) WriteNFO

func (n *Season) WriteNFO(destination string) error

type ShowType added in v0.14.0

type ShowType int

ShowType says if the media is a movie (one time broadcast), Show (recurring show) or a series (with seasons and episodes)

const (
	TypeNotSpecified ShowType = iota
	TypeSeries                // Series has seasons and episodes
	TypeMovie                 // Just one media
	TypeShow                  // Regular TV show
)

ShowType values

type TVShow

type TVShow struct {
	XMLName       xml.Name `xml:"tvshow"`
	Title         string   `xml:"title,omitempty"`
	OriginalTitle string   `xml:"originaltitle,omitempty"`
	Plot          string   `xml:"plot,omitempty"`
	Userrating    string   `xml:"userrating,omitempty"`
	MPAA          string   `xml:"mpaa,omitempty"`
	UniqueID      []ID     `xml:"uniqueid,omitempty"`
	Genre         []string `xml:"genre,omitempty"`
	Studio        string   `xml:"studio,omitempty"`
	Actor         []Actor  `xml:"actor,omitempty"`
	Thumb         []Thumb  `xml:"-"`
	HasEpisodes   bool     `xml:"-"` // True when the show has defined episodes
}

TVShow description named tvshow.nfo

func (TVShow) GetNFOPath

func (n TVShow) GetNFOPath(destination string) string

GetNFOPath returns the path for TVShow.nfo

func (*TVShow) WriteNFO

func (n *TVShow) WriteNFO(destination string) error

WriteNFO TVShow's NFO and download thumbnails

type Thumb

type Thumb struct {
	Aspect  string `xml:"aspect,attr,omitempty"`
	Preview string `xml:"preview,attr,omitempty"`
	URL     string `xml:",chardata"`
}

Thumb record

type ThumbLevel

type ThumbLevel int

ThumbLevel is the level where the thumbnail belongs to

Jump to

Keyboard shortcuts

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