tmdb

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 8 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 {
	GetMovie(id int) (*Movie, error)
	GetTVShow(id int) (*TVShow, error)
	GetTVEpisode(tvId, season, episodeNumber int) (*TVEpisode, error)
	GetTVSeasonEpisodes(id int, season int) ([]*TVEpisode, error)
	GetPopularMovies(page int) (*PaginatedMovieResults, error)
	GetPopularTVShows(page int) (*PaginatedTVShowResults, error)
	GetRecentMovies() ([]*Movie, error)
	GetRecentTVShows() ([]*TVShow, error)
	SearchMovies(query string, page int) (*PaginatedMovieResults, error)
	SearchTVShows(query string, page int) (*PaginatedTVShowResults, error)
	GetMoviesByGenre(genreID int, page int) (*PaginatedMovieResults, error)
	GetTVShowsByGenre(genreID int, page int) (*PaginatedTVShowResults, error)
	GetMoviesByActor(actorID int, page int) (*PaginatedMovieResults, error)
	GetMoviesByDirector(directorID int, page int) (*PaginatedMovieResults, error)
	GetMoviesByStudio(studioID int, page int) (*PaginatedMovieResults, error)
	GetTVShowsByActor(actorID int, page int) (*PaginatedTVShowResults, error)
	GetTVShowsByNetwork(studioID int, page int) (*PaginatedTVShowResults, error)
	GetTVShowsReleases(tvIds []int, startDate, endDate time.Time) ([]*TVEpisodeRelease, error)
	GetMoviesReleases(movieIds []int, startDate, endDate time.Time) ([]*MovieRelease, error)
	GetMovieRecommendations(movieId int) ([]*Movie, error)
	GetTVShowRecommendations(tvShowId int) ([]*TVShow, error)
	GetMovieGenre(genreID int) (*Genre, error)
	GetTVGenre(genreID int) (*Genre, error)
	GetMovieGenres() ([]*Genre, error)
	GetTVShowGenres() ([]*Genre, error)
	GetActor(actorID int) (*Actor, error)
	GetStudio(studioID int) (*Studio, error)
	GetNetwork(networkID int) (*Studio, error)
}

MediaClient is an interface for a media client API.

func NewMediaClient

func NewMediaClient(apiKey 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.

func (*Movie) ToMovieRelease added in v0.2.0

func (m *Movie) ToMovieRelease() *MovieRelease

type MovieRelease added in v0.2.0

type MovieRelease struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	ReleaseDate string `json:"releaseDate"`
}

MovieRelease represents a movie release with its attributes such as ID, title, and release date.

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.

func (*TVEpisode) ToEpisodeRelease added in v0.2.0

func (e *TVEpisode) ToEpisodeRelease(tvShowName string) *TVEpisodeRelease

type TVEpisodeRelease added in v0.2.0

type TVEpisodeRelease struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	EpisodeNumber int    `json:"episodeNumber"`
	SeasonNumber  int    `json:"seasonNumber"`
	TVShowName    string `json:"tvShowName"`
	AirDate       string `json:"airDate"`
}

TVEpisodeRelease represents a TV episode release with its attributes such as ID, name, episode

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