agents

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: GPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTmdbDate added in v0.3.0

func ParseTmdbDate(tmdbDate string) (time.Time, error)

ParseTmdbDate parses a date string returned from the TMDB API

Types

type MetadataRetrievalAgent added in v0.3.0

type MetadataRetrievalAgent interface {
	UpdateMovieMD(movie *db.Movie, tmdbID int) error
	UpdateSeasonMD(season *db.Season, seriesTmdbID int, seasonNum int) error
	UpdateEpisodeMD(episode *db.Episode, seriesTmdbID int, seasonNum int, episodeNum int) error
	UpdateSeriesMD(series *db.Series, tmdbID int) error
	// TODO(Leon Handreke): This totally breaks the abstraction, but we need the interface
	//  to be able to fake it.
	TmdbSearchMovie(name string, options map[string]string) (*tmdb.MovieSearchResults, error)
	TmdbSearchTv(name string, options map[string]string) (*tmdb.TvSearchResults, error)
}

MetadataRetrievalAgent can retrieve metadata for media items.

type TmdbAgent

type TmdbAgent struct {
	Tmdb *tmdb.TMDb
}

TmdbAgent is a wrapper around themoviedb

func NewTmdbAgent

func NewTmdbAgent() *TmdbAgent

NewTmdbAgent creates a new themoviedb agent.

func (*TmdbAgent) TmdbSearchMovie added in v0.3.0

func (a *TmdbAgent) TmdbSearchMovie(
	name string,
	options map[string]string,
) (*tmdb.MovieSearchResults, error)

TmdbSearchMovie directly exposes the TMDb search interface

func (*TmdbAgent) TmdbSearchTv added in v0.3.0

func (a *TmdbAgent) TmdbSearchTv(
	name string,
	options map[string]string,
) (*tmdb.TvSearchResults, error)

TmdbSearchTv directly exposes the TMDb search interface

func (*TmdbAgent) UpdateEpisodeMD

func (a *TmdbAgent) UpdateEpisodeMD(
	episode *db.Episode, seriesTmdbID int, seasonNum int, episodeNum int,
) error

UpdateEpisodeMD updates the metadata information for the given episode.

func (*TmdbAgent) UpdateMovieMD

func (a *TmdbAgent) UpdateMovieMD(movie *db.Movie, tmdbID int) error

UpdateMovieMD updates

func (*TmdbAgent) UpdateSeasonMD

func (a *TmdbAgent) UpdateSeasonMD(season *db.Season, seriesTmdbID int, seasonNum int) error

UpdateSeasonMD updates the metadata information for the given season

func (*TmdbAgent) UpdateSeriesMD

func (a *TmdbAgent) UpdateSeriesMD(series *db.Series, tmdbID int) error

UpdateSeriesMD updates the metadata information for the given series.

Jump to

Keyboard shortcuts

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