nfo

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 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) GetMediaPath

func (n EpisodeDetails) GetMediaPath(destination string) string

GetMediaPath gives the full filename of given media

func (EpisodeDetails) GetMediaPathMatcher

func (n EpisodeDetails) GetMediaPathMatcher(destination string) string

GetMediaPathMatcher gives a name matcher for mis numbered episodes

func (EpisodeDetails) GetNFOPath

func (n EpisodeDetails) GetNFOPath(destination string) string

GetNFOPath give the path where the episode's NFO should be

func (EpisodeDetails) GetSeasonNFOPath

func (n EpisodeDetails) GetSeasonNFOPath(destination string) string

GetShowNFOPath returns the path for TVShow.nfo

func (*EpisodeDetails) GetSeasonPath

func (n *EpisodeDetails) GetSeasonPath(destination string) string

GetSeasonPath give the path for the series' season

func (EpisodeDetails) GetSeriesPath

func (n EpisodeDetails) GetSeriesPath(destination string) string

GetSeriesPath gives path for the whole series

func (EpisodeDetails) GetShowNFOPath

func (n EpisodeDetails) GetShowNFOPath(destination string) string

GetShowNFOPath returns the path for TVShow.nfo

func (*EpisodeDetails) WriteNFO

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

WriteNFO file at expected place

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"`

	URL        string  `xml:"-"` // Media URL
	IsSpecial  bool    `xml:"-"` // True when special episode
	SeasonInfo *Season `xml:"-"` // Possible Season nfo
	TVShow     *TVShow `xml:"-"` // Possible TVShow nfo
}

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) GetMediaPath

func (n Movie) GetMediaPath(destination string) string

GetMediaPath returns the media path

func (Movie) GetMediaPathMatcher

func (n Movie) GetMediaPathMatcher(destination string) string

func (Movie) GetNFOPath

func (n Movie) GetNFOPath(destination string) string

GetNFOPath give the path where the episode's NFO should be

func (Movie) GetSeasonNFOPath

func (n Movie) GetSeasonNFOPath(destination string) string

GetSeasonNFOPath returns the path for TVShow.nfo

func (Movie) GetSeasonPath

func (n Movie) GetSeasonPath(destination string) string

GetSeasonPath give the path for the series' season

func (Movie) GetSeriesPath

func (n Movie) GetSeriesPath(destination string) string

GetSeriesPath gives path for the whole series

func (Movie) GetShowNFOPath

func (n Movie) GetShowNFOPath(destination string) string

GetShowNFOPath returns the path for TVShow.nfo

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 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