media

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrItemNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(cfg *Config) (*Client, error)

func (*Client) GetMovieInfo

func (c *Client) GetMovieInfo(item *FeedItem) (*Item, error)

func (*Client) GetShowInfo

func (c *Client) GetShowInfo(item *FeedItem) (*Item, error)

type Config

type Config struct {
	Trakt trakt.Config `yaml:"trakt"`
	Omdb  omdb.Config  `yaml:"omdb"`
	Tvdb  tvdb.Config  `yaml:"tvdb"`

	Verbosity string `yaml:"verbosity,omitempty"`
}

type FeedItem

type FeedItem struct {
	Title    string `xml:"title,omitempty"`
	Category string `xml:"category,omitempty"`
	GUID     string `xml:"guid,omitempty"`
	PubDate  Time   `xml:"pubDate,omitempty"`

	// set by processor
	Feed string

	// attributes
	Language string
	TvdbId   string `xml:"tvdb,omitempty"`
	TvMazeId string
	ImdbId   string `xml:"imdb,omitempty"`
	TmdbId   string `xml:"tmdb,omitempty"`

	Attributes []struct {
		XMLName xml.Name
		Name    string `xml:"name,attr"`
		Value   string `xml:"value,attr"`
	} `xml:"attr"`
}

func (*FeedItem) GetProviderData

func (f *FeedItem) GetProviderData() (string, string)

type Item

type Item struct {
	TvdbId        string    `json:"TvdbId,omitempty"`
	TmdbId        string    `json:"TmdbId,omitempty"`
	ImdbId        string    `json:"ImdbId,omitempty"`
	Slug          string    `json:"Slug,omitempty"`
	FeedTitle     string    `json:"FeedTitle,omitempty"`
	Title         string    `json:"Title,omitempty"`
	Summary       string    `json:"Summary,omitempty"`
	Country       []string  `json:"Country,omitempty"`
	Network       string    `json:"Network,omitempty"`
	Date          time.Time `json:"Date"`
	Year          int       `json:"Year,omitempty"`
	Runtime       int       `json:"Runtime,omitempty"`
	Rating        float64   `json:"Rating,omitempty"`
	Votes         int       `json:"Votes,omitempty"`
	Status        string    `json:"Status,omitempty"`
	Genres        []string  `json:"Genres,omitempty"`
	Languages     []string  `json:"Languages,omitempty"`
	AiredEpisodes int       `json:"AiredEpisodes,omitempty"`

	// additional media provider data
	Omdb omdb.Item `json:"Omdb,omitempty"`
	Tvdb tvdb.Item `json:"Tvdb,omitempty"`
}

func (*Item) GetProviderData

func (i *Item) GetProviderData() (string, string)

type Rss

type Rss struct {
	Channel struct {
		Items []FeedItem `xml:"item"`
	} `xml:"channel"`
}

type Time

type Time struct {
	time.Time
}

Time credits: https://github.com/mrobinsn/go-newznab/blob/cd89d9c56447859fa1298dc9a0053c92c45ac7ef/newznab/structs.go#L150

func (*Time) MarshalXML

func (t *Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Time) UnmarshalXML

func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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