tmdb

package
v0.7.12-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SourceImdb = "imdb"
View Source
const SourceTmdb = "tmdb"
View Source
const SourceTvdb = "tvdb"

Variables

View Source
var (
	ErrUnknownSource = errors.New("unknown source")
)

Functions

func MovieDetailsToMovieModel

func MovieDetailsToMovieModel(details tmdb.MovieDetailsResponse) (movie model.Content, err error)

func TvShowDetailsToTvShowModel

func TvShowDetailsToTvShowModel(details tmdb.TvDetailsResponse) (movie model.Content, err error)

Types

type Client

type Client interface {
	MovieClient
	TvShowClient
}

type MovieClient

type MovieClient interface {
	SearchMovie(ctx context.Context, p SearchMovieParams) (model.Content, error)
	GetMovieByExternalId(ctx context.Context, source, id string) (model.Content, error)
}

type Params

type Params struct {
	fx.In
	Search     lazy.Lazy[search.Search]
	TmdbClient lazy.Lazy[tmdb.Client]
	Logger     *zap.SugaredLogger
}

type Result

type Result struct {
	fx.Out
	Client lazy.Lazy[Client]
}

func New

func New(p Params) Result

type SearchMovieParams

type SearchMovieParams struct {
	Title                string
	Year                 model.Year
	IncludeAdult         bool
	LevenshteinThreshold uint
}

type SearchTvShowParams

type SearchTvShowParams struct {
	Name                 string
	Year                 model.Year
	IncludeAdult         bool
	LevenshteinThreshold uint
}

type TvShowClient

type TvShowClient interface {
	SearchTvShow(ctx context.Context, p SearchTvShowParams) (model.Content, error)
	GetTvShowByExternalId(ctx context.Context, source, id string) (model.Content, error)
}

Jump to

Keyboard shortcuts

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