tmdb

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor added in v0.5.3

type Actor struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	ProfileURL string `json:"profileUrl"`
	Overview   string `json:"overview"`
}

Actor represents a person

type Genre

type Genre struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Genre represents a movie/TV genre with its ID and name.

type MediaClient

type MediaClient interface {
	GetActor(actorID int) (*Actor, error)
	GetMovie(id int) (*Movie, error)
	GetMovieGenre(genreID int) (*Genre, error)
	GetMovieGenres() ([]*Genre, error)
	GetMovieRecommendations(movieID int) ([]*Movie, error)
	GetMoviesByActor(actorID int, page int) (*PaginatedMovieResults, error)
	GetMoviesByDirector(directorID int, page int) (*PaginatedMovieResults, error)
	GetMoviesByGenre(genreID int, page int) (*PaginatedMovieResults, error)
	GetMoviesByStudio(studioID int, page int) (*PaginatedMovieResults, error)
	GetMovieShort(movieID int) (*Movie, error)
	GetMoviesReleases(movieIds []int, startDate, endDate time.Time) ([]*Movie, error)
	GetNetwork(networkID int) (*Studio, error)
	GetPopularMovies(page int) (*PaginatedMovieResults, error)
	GetPopularTVShows(page int) (*PaginatedTVShowResults, error)
	GetRecentMovies() ([]*Movie, error)
	GetRecentTVShows() ([]*TVShow, error)
	GetStudio(studioID int) (*Studio, error)
	GetTVEpisode(tvID, season, episodeNumber int) (*TVEpisode, error)
	GetTVGenre(genreID int) (*Genre, error)
	GetTVSeasonEpisodes(id int, season int) ([]*TVEpisode, error)
	GetTVShow(id int) (*TVShow, error)
	GetTVShowGenres() ([]*Genre, error)
	GetTVShowRecommendations(tvShowID int) ([]*TVShow, error)
	GetTVShowsByActor(actorID int, page int) (*PaginatedTVShowResults, error)
	GetTVShowsByGenre(genreID int, page int) (*PaginatedTVShowResults, error)
	GetTVShowsByNetwork(studioID int, page int) (*PaginatedTVShowResults, error)
	GetTVShowShort(tvShowID int) (*TVShow, error)
	GetTVShowsReleases(tvIds []int, startDate, endDate time.Time) ([]*TVEpisode, []*TVShow, error)
	SearchMovies(query string, page int, adult bool) (*PaginatedMovieResults, error)
	SearchMoviesYear(query string, year string, page int) (*PaginatedMovieResults, error)
	SearchTVShows(query string, page int, adult bool) (*PaginatedTVShowResults, error)
	SearchActors(query string, page int, adult bool) (*PaginatedActorResults, error)
}

MediaClient is an interface for a media client API.

func NewMediaClient

func NewMediaClient(apiKey string) MediaClient

func NewRedisMediaClient added in v1.4.0

func NewRedisMediaClient(apiKey, redisHost, redisPass string) MediaClient

type Movie

type Movie struct {
	ID          int      `json:"id"`
	Actors      []Person `json:"actors"`
	BackdropURL string   `json:"backdropUrl"`
	Crew        []Person `json:"crew"`
	Genres      []Genre  `json:"genres"`
	Overview    string   `json:"overview"`
	PosterURL   string   `json:"posterUrl"`
	ReleaseDate string   `json:"releaseDate"`
	Studios     []Studio `json:"studios"`
	Title       string   `json:"title"`
	VoteAverage float32  `json:"voteAverage"`
	VoteCount   int      `json:"voteCount"`
}

Movie represents a movie with its attributes such as ID, actors list (Person), backdrop URL, crew list (Person), genre list (Genre), overview, poster URL, release date, studio list (Studio), title, vote average, and vote count.

type PaginatedActorResults added in v1.7.0

type PaginatedActorResults struct {
	Results     []*Actor
	TotalPage   int
	TotalResult int
}

type PaginatedMovieResults added in v0.3.0

type PaginatedMovieResults struct {
	Results     []*Movie
	TotalPage   int
	TotalResult int
}

type PaginatedTVShowResults added in v0.3.0

type PaginatedTVShowResults struct {
	Results     []*TVShow
	TotalPage   int
	TotalResult int
}

type Person

type Person struct {
	ID         int    `json:"id"`
	Character  string `json:"character"`
	Name       string `json:"name"`
	ProfileURL string `json:"profileUrl"`
}

Person represents a person involved in a movie or TV show with their ID, character name, real name, and the URL to their profile picture.

type Studio

type Studio struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	LogoURL string `json:"logoUrl"`
}

Studio represents a movie/TV studio with its ID, name, and logo URL.

type TVEpisode

type TVEpisode struct {
	ID            int    `json:"id"`
	TVShowID      int    `json:"tvShowId"`
	PosterURL     string `json:"posterUrl"`
	EpisodeNumber int    `json:"episodeNumber"`
	SeasonNumber  int    `json:"seasonNumber"`
	Name          string `json:"name"`
	Overview      string `json:"overview"`
	AirDate       string `json:"airDate"`
}

TVEpisode represents a TV episode with its attributes such as ID, TV show ID, poster URL, season number, episode number, name, overview, and air date.

type TVShow

type TVShow struct {
	ID            int        `json:"id"`
	Actors        []Person   `json:"actors"`
	BackdropURL   string     `json:"backdropUrl"`
	Crew          []Person   `json:"crew"`
	Genres        []Genre    `json:"genres"`
	Overview      string     `json:"overview"`
	PosterURL     string     `json:"posterUrl"`
	ReleaseDate   string     `json:"releaseDate"`
	Networks      []Studio   `json:"networks"`
	Status        string     `json:"status"`
	NextEpisode   *TVEpisode `json:"nextEpisode"`
	Title         string     `json:"title"`
	SeasonsCount  int        `json:"seasonsCount"`
	EpisodesCount int        `json:"episodesCount"`
	VoteAverage   float32    `json:"voteAverage"`
	VoteCount     int        `json:"voteCount"`
}

TVShow represents a TV show with its attributes such as ID, actors list (Person), backdrop URL, crew list (Person), genre list (Genre), overview, poster URL, release date, studio list (Studio), status, next episode (TVEpisode), title, seasons count, vote average, and vote count.

Jump to

Keyboard shortcuts

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