tmdb

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package tmdb provides a good coverage for the TMDB API, supporting movies, shows, people and images.

Index

Constants

View Source
const (
	Backdrop300      = "w300"
	Backdrop780      = "w780"
	Backdrop1280     = "w1280"
	BackdropOriginal = "original"
)
View Source
const (
	Poster92       = "w92"
	Poster154      = "w154"
	Poster185      = "w185"
	Poster342      = "w342"
	Poster500      = "w500"
	Poster780      = "w780"
	PosterOriginal = "original"
)
View Source
const (
	Profile45       = "w45"
	Profile185      = "w185"
	Profile632      = "h632"
	ProfileOriginal = "original"
)
View Source
const (
	TypePremiere = iota + 1
	TypeTheatricalLimited
	TypeTheatrical
	TypeDigital
	TypePhysical
	TypeTV
)

https://developers.themoviedb.org/3/movies/get-movie-release-dates

View Source
const (
	// ISO 639-1
	LanguageEnglish = "en-US"
)

Variables

View Source
var (
	ErrReleaseTypeNotFound = errors.New("release type not found")
)

Functions

This section is empty.

Types

type Cast

type Cast struct {
	ID           int    `json:"id"` // unique person ID
	Name         string `json:"name"`
	OriginalName string `json:"original_name"`
	ProfilePath  string `json:"profile_path"`
	Character    string `json:"character"`
	Order        int    `json:"order"`
}

type Collection

type Collection struct {
	ID           int    `json:"id"` // unique collection ID
	Name         string `json:"name"`
	Overview     string `json:"overview"`
	BackdropPath string `json:"backdrop_path"`
	PosterPath   string `json:"poster_path"`
}

type Config

type Config struct {
	Key      string
	Language string
}

type Credits

type Credits struct {
	ID     int    `json:"id"` // unique movie or tv ID
	Cast   []Cast `json:"cast"`
	Crew   []Crew `json:"crew"`
	Guests []Cast `json:"guest_stars"` // only tv
}

type Crew

type Crew struct {
	ID           int    `json:"id"` // unique person ID
	Name         string `json:"name"`
	OriginalName string `json:"original_name"`
	ProfilePath  string `json:"profile_path"`
	Department   string `json:"department"`
	Job          string `json:"job"`
}

type Episode

type Episode struct {
	ID            int     `json:"id"` // unique episode ID
	StillPath     string  `json:"still_path"`
	AirDate       string  `json:"air_date"`
	Name          string  `json:"name"`
	Overview      string  `json:"overview"`
	SeasonNumber  int     `json:"season_number"`
	EpisodeNumber int     `json:"episode_number"`
	VoteAverage   float32 `json:"vote_average"`
	VoteCount     int     `json:"vote_count"`
}

type Genre

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

type Genres

type Genres map[int]string

type Keyword

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

type Keywords

type Keywords struct {
	ID       int       `json:"id"`
	Keywords []Keyword `json:"keywords"`
}

type Movie

type Movie struct {
	ID               int        `json:"id"` // unique movie ID
	IMDB_ID          string     `json:"imdb_id"`
	Adult            bool       `json:"adult"`
	BackdropPath     string     `json:"backdrop_path"`
	Collection       Collection `json:"belongs_to_collection"`
	Genres           []Genre    `json:"genres"`
	OriginalLanguage string     `json:"original_language"`
	OriginalTitle    string     `json:"original_title"`
	Overview         string     `json:"overview"`
	Popularity       float32    `json:"populartity"`
	PosterPath       string     `json:"poster_path"`
	ReleaseDate      string     `json:"release_date"`
	Tagline          string     `json:"tagline"`
	Title            string     `json:"title"`
	Video            bool       `json:"video"`
	VoteAverage      float32    `json:"vote_average"`
	VoteCount        int        `json:"vote_count"`
	Budget           int64      `json:"budget"`
	Revenue          int64      `json:"revenue"`
	Runtime          int        `json:"runtime"`
}

type MovieResult

type MovieResult struct {
	Adult         bool   `json:"adult"`
	OriginalTitle string `json:"original_title"`
	ReleaseDate   string `json:"release_date"`
	Title         string `json:"title"`
	Video         bool   `json:"video"`
	// contains filtered or unexported fields
}

type Network

type Network struct {
	ID            int    `json:"id"` // unique network ID
	Name          string `json:"name"`
	LogoPath      string `json:"logo_path"`
	OriginCountry string `json:"origin_country"`
}

type Person

type Person struct {
	ID          int    `json:"id"` // unique person ID
	IMDB_ID     string `json:"imdb_id"`
	Name        string `json:"name"`
	ProfilePath string `json:"profile_path"`
	Birthday    string `json:"birthday"`
	Deathday    string `json:"deathday"`
	Biography   string `json:"biography"`
	Birthplace  string `json:"place_of_birth"`
}

type Release

type Release struct {
	Certification string `json:"certification"`
	Date          string `json:"release_date"`
	Note          string `json:"note"`
	Type          int    `json:"type"`
}

type ReleaseCountry

type ReleaseCountry struct {
	CountryCode string    `json:"iso_3166_1"`
	Releases    []Release `json:"release_dates"`
}

type Releases

type Releases struct {
	ID      int              `json:"id"`
	Results []ReleaseCountry `json:"results"`
}

type Season

type Season struct {
	ID           int    `json:"id"` // unique season ID
	AirDate      string `json:"air_date"`
	EpisodeCount int    `json:"episode_count"`
	Name         string `json:"name"`
	Overview     string `json:"overview"`
	PosterPath   string `json:"poster_path"`
	SeasonNumber int    `json:"season_number"`
}

type TMDB

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

func NewTMDB

func NewTMDB(config Config, client client.Getter) *TMDB

func (*TMDB) Backdrop

func (m *TMDB) Backdrop(backdropPath string, size string) *url.URL

func (*TMDB) EpisodeCredits

func (m *TMDB) EpisodeCredits(tvid, season, episode int) (Credits, error)

func (*TMDB) EpisodeDetail

func (m *TMDB) EpisodeDetail(tvid, season, episode int) (Episode, error)

func (*TMDB) MovieCredits

func (m *TMDB) MovieCredits(tmid int) (Credits, error)

func (*TMDB) MovieDetail

func (m *TMDB) MovieDetail(tmid int) (Movie, error)

func (*TMDB) MovieGenre

func (m *TMDB) MovieGenre(id int) string

func (*TMDB) MovieGenreNames

func (m *TMDB) MovieGenreNames() []string

func (*TMDB) MovieKeywordNames

func (m *TMDB) MovieKeywordNames(id int) ([]string, error)

func (*TMDB) MovieReleaseType

func (m *TMDB) MovieReleaseType(tmid int, country string, releaseType int) (Release, error)

func (*TMDB) MovieReleases

func (m *TMDB) MovieReleases(tmid int) (map[string][]Release, error)

func (*TMDB) MovieSearch

func (m *TMDB) MovieSearch(q string) ([]MovieResult, error)

func (*TMDB) OriginalPoster

func (m *TMDB) OriginalPoster(posterPath string) *url.URL

func (*TMDB) PersonDetail

func (m *TMDB) PersonDetail(peid int) (Person, error)

func (*TMDB) PersonProfile

func (m *TMDB) PersonProfile(profilePath string, size string) *url.URL

func (*TMDB) Poster

func (m *TMDB) Poster(posterPath string, size string) *url.URL

func (*TMDB) TVDetail

func (m *TMDB) TVDetail(tvid int) (TV, error)

func (*TMDB) TVGenre

func (m *TMDB) TVGenre(id int) string

func (*TMDB) TVGenreNames

func (m *TMDB) TVGenreNames() []string

func (*TMDB) TVKeywordNames

func (m *TMDB) TVKeywordNames(tvid int) ([]string, error)

func (*TMDB) TVSearch

func (m *TMDB) TVSearch(q string) ([]TVResult, error)

type TV

type TV struct {
	ID               int       `json:"id"` // unique tv ID
	BackdropPath     string    `json:"backdrop_path"`
	PosterPath       string    `json:"poster_path"`
	Genres           []Genre   `json:"genres"`
	FirstAirDate     string    `json:"first_air_date"`
	LastAirDate      string    `json:"last_air_date"`
	Name             string    `json:"name"`
	OriginalName     string    `json:"original_name"`
	OriginalLanguage string    `json:"original_language"`
	Overview         string    `json:"overview"`
	Networks         []Network `json:"networks"`
	NumberOfEpisodes int       `json:"number_of_episodes"`
	NumberOfSeasons  int       `json:"number_of_seasons"`
	Popularity       float32   `json:"populartity"`
	Seasons          []Season  `json:"seasons"`
	Status           string    `json:"status"`
	Tagline          string    `json:"tagline"`
	Type             string    `json:"type"`
	VoteAverage      float32   `json:"vote_average"`
	VoteCount        int       `json:"vote_count"`
}

type TVResult

type TVResult struct {
	FirstAirDate string `json:"first_air_date"`
	Name         string `json:"name"`
	OriginalName string `json:"original_name"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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