tmdb

package
v0.1.119 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TMDBResultsPerPage reflects TMDB number of results on the page. It's statically set to 20, so we should work with that
	TMDBResultsPerPage = 20
)

Variables

View Source
var (
	WarmingUp = event.Event{}

	//                                                  Original    High    Medium  Low
	ImageQualitiesPoster    = []ImageQualityIdentifier{"original", "w780", "w500", "w342"}
	ImageQualitiesFanArt    = []ImageQualityIdentifier{"original", "w1280", "w1280", "w780"}
	ImageQualitiesThumbnail = []ImageQualityIdentifier{"original", "w1280", "w780", "w500"}
	ImageQualitiesLandscape = []ImageQualityIdentifier{"original", "w1280", "w780", "w500"}
)

Functions

func CheckAPIKey

func CheckAPIKey()

CheckAPIKey ...

func GetLocalizedImages

func GetLocalizedImages(images []*Image, imageQuality ImageQualityIdentifier) (localizedImage string, allImages []string, imagesWithText []string, imagesWithoutText []string)

GetLocalizedImages returns localized image, all images, images with text and images without text, so those can be used to set Kodi Arts To find localized image we use: user's language -> second language -> English.

func GetUserLanguages

func GetUserLanguages() (languagesList string)

GetUserLanguages returns list of user languages to be used with include_*_language query parameters

func ImageURL

func ImageURL(uri string, size ImageQualityIdentifier) (imageURL string)

ImageURL ...

func LogError

func LogError(err error)

LogError ...

func PersonShows added in v0.1.117

func PersonShows(personID int) []int

PersonShows returns ids of shows a person played in or worked on, the ones with most episodes first, as TMDB popularity would put one-episode guest roles in hit shows on top.

func SetLocalizedArt

func SetLocalizedArt(video *Entity, item *xbmc.ListItem)

func SetTrailer added in v0.1.104

func SetTrailer(entity *Entity, item *xbmc.ListItem)

Types

type APIRequest

type APIRequest struct {
	URL         string
	Params      url.Values `msg:"-"`
	Result      any
	ErrMsg      any
	Description string
}

APIRequest ...

type AlternativeTitle

type AlternativeTitle struct {
	Iso3166_1 string `json:"iso_3166_1"`
	Title     string `json:"title"`
	Type      string `json:"type"`
}

AlternativeTitle ...

func (AlternativeTitle) MarshalMsg added in v0.1.115

func (z AlternativeTitle) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (AlternativeTitle) Msgsize added in v0.1.115

func (z AlternativeTitle) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AlternativeTitle) UnmarshalMsg added in v0.1.115

func (z *AlternativeTitle) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Cast

type Cast struct {
	IDName
	CastID      int    `json:"cast_id"`
	Character   string `json:"character"`
	CreditID    string `json:"credit_id"`
	Order       int    `json:"order"`
	ProfilePath string `json:"profile_path"`
}

Cast ...

func PopularPeople added in v0.1.117

func PopularPeople(language string, page int) (people []*Cast, totalPages int)

PopularPeople returns a page of TMDB popular people, Cast carries the id, name and profile_path they have

func (*Cast) MarshalMsg added in v0.1.115

func (z *Cast) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Cast) Msgsize added in v0.1.115

func (z *Cast) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Cast) UnmarshalMsg added in v0.1.115

func (z *Cast) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ContentRating

type ContentRating struct {
	Iso3166_1 string `json:"iso_3166_1"`
	Rating    string `json:"rating"`
}

ContentRating ...

func (ContentRating) MarshalMsg added in v0.1.115

func (z ContentRating) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ContentRating) Msgsize added in v0.1.115

func (z ContentRating) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ContentRating) UnmarshalMsg added in v0.1.115

func (z *ContentRating) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Country

type Country struct {
	Iso31661    string `json:"iso_3166_1"`
	Name        string `json:"name"`
	NativeName  string `json:"native_name"`
	EnglishName string `json:"english_name"`
}

Country ...

func GetCountries

func GetCountries(language string) []*Country

GetCountries ...

func (*Country) MarshalMsg added in v0.1.115

func (z *Country) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Country) Msgsize added in v0.1.115

func (z *Country) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Country) UnmarshalMsg added in v0.1.115

func (z *Country) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type CountryList

type CountryList []*Country

CountryList ...

func (CountryList) MarshalMsg added in v0.1.115

func (z CountryList) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (CountryList) Msgsize added in v0.1.115

func (z CountryList) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CountryList) UnmarshalMsg added in v0.1.115

func (z *CountryList) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Credits

type Credits struct {
	Cast []*Cast `json:"cast"`
	Crew []*Crew `json:"crew"`
}

Credits ...

func (*Credits) GetCastMembers

func (credits *Credits) GetCastMembers() []xbmc.ListItemCastMember

GetCastMembers returns formatted cast members

func (*Credits) GetDirectors

func (credits *Credits) GetDirectors() []string

GetDirectors returns list of directors

func (*Credits) GetWriters

func (credits *Credits) GetWriters() []string

GetWriters returns list of writers

func (*Credits) MarshalMsg added in v0.1.115

func (z *Credits) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Credits) Msgsize added in v0.1.115

func (z *Credits) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Credits) UnmarshalMsg added in v0.1.115

func (z *Credits) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Crew

type Crew struct {
	IDName
	CreditID    string `json:"credit_id"`
	Department  string `json:"department"`
	Job         string `json:"job"`
	ProfilePath string `json:"profile_path"`
}

Crew ...

func (*Crew) MarshalMsg added in v0.1.115

func (z *Crew) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Crew) Msgsize added in v0.1.115

func (z *Crew) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Crew) UnmarshalMsg added in v0.1.115

func (z *Crew) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type DiscoverFilters

type DiscoverFilters struct {
	Genre    string
	Country  string
	Language string
}

DiscoverFilters ...

func (DiscoverFilters) MarshalMsg added in v0.1.115

func (z DiscoverFilters) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (DiscoverFilters) Msgsize added in v0.1.115

func (z DiscoverFilters) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*DiscoverFilters) UnmarshalMsg added in v0.1.115

func (z *DiscoverFilters) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Entity

type Entity struct {
	BackdropPath     string    `json:"backdrop_path"`
	FirstAirDate     string    `json:"first_air_date"`
	Genres           []*IDName `json:"genres"`
	ID               int       `json:"id"`
	IsAdult          bool      `json:"adult"`
	Name             string    `json:"name,omitempty"`
	OriginalLanguage string    `json:"original_language,omitempty"`
	OriginalName     string    `json:"original_name,omitempty"`
	OriginalTitle    string    `json:"original_title,omitempty"`
	Overview         string    `json:"overview"`
	PosterPath       string    `json:"poster_path"`
	ReleaseDate      string    `json:"release_date"`
	Title            string    `json:"title,omitempty"`
	VoteAverage      float32   `json:"vote_average"`
	VoteCount        int       `json:"vote_count"`

	Images *Images `json:"images,omitempty"`

	Translations *struct {
		Translations []*Translation `json:"translations"`
	} `json:"translations"`

	Videos *struct {
		Videos []*Trailer `json:"results"`
	} `json:"videos"`

	Credits *Credits `json:"credits,omitempty"`

	ExternalIDs *ExternalIDs `json:"external_ids"`
}

Entity ...

func (*Entity) MarshalMsg added in v0.1.115

func (z *Entity) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Entity) Msgsize added in v0.1.115

func (z *Entity) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Entity) UnmarshalMsg added in v0.1.115

func (z *Entity) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EntityList

type EntityList struct {
	Page         int       `json:"page"`
	Results      []*Entity `json:"results"`
	TotalPages   int       `json:"total_pages"`
	TotalResults int       `json:"total_results"`
}

EntityList ...

func (*EntityList) MarshalMsg added in v0.1.115

func (z *EntityList) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*EntityList) Msgsize added in v0.1.115

func (z *EntityList) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EntityList) UnmarshalMsg added in v0.1.115

func (z *EntityList) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Episode

type Episode struct {
	Entity

	AirDate       string `json:"air_date"`
	EpisodeNumber int    `json:"episode_number"`
	Runtime       int    `json:"runtime"`
	SeasonNumber  int    `json:"season_number"`
	StillPath     string `json:"still_path"`
}

Episode ...

func GetEpisode

func GetEpisode(showID int, seasonNumber int, episodeNumber int, language string) *Episode

GetEpisode ...

func (*Episode) GetLowestAirDate

func (episode *Episode) GetLowestAirDate(airDate string, airDateFormat string) (newAirDate string, newAirDateFormat string)

func (*Episode) GetName

func (episode *Episode) GetName(show *Show) string

func (*Episode) GetSearchTitle added in v0.1.110

func (episode *Episode) GetSearchTitle(show *Show) string

func (*Episode) MarshalMsg added in v0.1.115

func (z *Episode) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Episode) Msgsize added in v0.1.115

func (z *Episode) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Episode) SetArt

func (episode *Episode) SetArt(show *Show, season *Season, item *xbmc.ListItem)

SetArt sets artworks for episode

func (*Episode) ToListItem

func (episode *Episode) ToListItem(show *Show, season *Season) *xbmc.ListItem

ToListItem ...

func (*Episode) UnmarshalMsg added in v0.1.115

func (z *Episode) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EpisodeList

type EpisodeList []*Episode

EpisodeList ...

func (EpisodeList) MarshalMsg added in v0.1.115

func (z EpisodeList) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (EpisodeList) Msgsize added in v0.1.115

func (z EpisodeList) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (EpisodeList) ToListItems

func (episodes EpisodeList) ToListItems(show *Show, season *Season) []*xbmc.ListItem

ToListItems ...

func (*EpisodeList) UnmarshalMsg added in v0.1.115

func (z *EpisodeList) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ExternalIDs

type ExternalIDs struct {
	IMDBId      string `json:"imdb_id"`
	FreeBaseID  string `json:"freebase_id"`
	FreeBaseMID string `json:"freebase_mid"`
	TVDBID      any    `json:"tvdb_id"`
}

ExternalIDs ...

func (*ExternalIDs) MarshalMsg added in v0.1.115

func (z *ExternalIDs) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ExternalIDs) Msgsize added in v0.1.115

func (z *ExternalIDs) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ExternalIDs) UnmarshalMsg added in v0.1.115

func (z *ExternalIDs) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type FindResult

type FindResult struct {
	MovieResults     []*Entity `json:"movie_results"`
	PersonResults    []*Entity `json:"person_results"`
	TVResults        []*Entity `json:"tv_results"`
	TVEpisodeResults []*Entity `json:"tv_episode_results"`
	TVSeasonResults  []*Entity `json:"tv_season_results"`
}

FindResult ...

func Find

func Find(externalID string, externalSource string) *FindResult

Find ...

func (*FindResult) MarshalMsg added in v0.1.115

func (z *FindResult) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*FindResult) Msgsize added in v0.1.115

func (z *FindResult) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*FindResult) UnmarshalMsg added in v0.1.115

func (z *FindResult) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Genre

type Genre IDName

Genre ...

func GetMovieGenres

func GetMovieGenres(language string) []*Genre

GetMovieGenres ...

func GetTVGenres

func GetTVGenres(language string) []*Genre

GetTVGenres ...

func (Genre) MarshalMsg added in v0.1.115

func (z Genre) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Genre) Msgsize added in v0.1.115

func (z Genre) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Genre) UnmarshalMsg added in v0.1.115

func (z *Genre) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type GenreList

type GenreList struct {
	Genres []*Genre `json:"genres"`
}

GenreList ...

func (*GenreList) MarshalMsg added in v0.1.115

func (z *GenreList) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*GenreList) Msgsize added in v0.1.115

func (z *GenreList) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*GenreList) UnmarshalMsg added in v0.1.115

func (z *GenreList) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type IDName

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

IDName ...

func SearchPeople added in v0.1.115

func SearchPeople(query string, language string) []*IDName

SearchPeople returns people matching the name, most popular first

func (IDName) MarshalMsg added in v0.1.115

func (z IDName) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (IDName) Msgsize added in v0.1.115

func (z IDName) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*IDName) UnmarshalMsg added in v0.1.115

func (z *IDName) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type IDNameLogo struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	OriginCountry string `json:"origin_country"`
}

IDNameLogo ...

func (*IDNameLogo) MarshalMsg added in v0.1.115

func (z *IDNameLogo) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*IDNameLogo) Msgsize added in v0.1.115

func (z *IDNameLogo) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*IDNameLogo) UnmarshalMsg added in v0.1.115

func (z *IDNameLogo) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Image

type Image struct {
	FilePath string `json:"file_path"`
	Height   int    `json:"height"`
	Iso639_1 string `json:"iso_639_1"`
	Width    int    `json:"width"`
}

Image ...

func (*Image) MarshalMsg added in v0.1.115

func (z *Image) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Image) Msgsize added in v0.1.115

func (z *Image) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Image) UnmarshalMsg added in v0.1.115

func (z *Image) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ImageQualityBundle

type ImageQualityBundle struct {
	Poster    ImageQualityIdentifier
	FanArt    ImageQualityIdentifier
	Thumbnail ImageQualityIdentifier
	Landscape ImageQualityIdentifier
}

ImageQualityBundle contains image qualities for different type of images

func GetImageQualities

func GetImageQualities() (imageQualities ImageQualityBundle)

func (*ImageQualityBundle) MarshalMsg added in v0.1.115

func (z *ImageQualityBundle) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ImageQualityBundle) Msgsize added in v0.1.115

func (z *ImageQualityBundle) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ImageQualityBundle) UnmarshalMsg added in v0.1.115

func (z *ImageQualityBundle) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ImageQualityIdentifier

type ImageQualityIdentifier string

ImageQualityIdentifier contains the image quality as a string, e.g. "w1280"

func (ImageQualityIdentifier) MarshalMsg added in v0.1.115

func (z ImageQualityIdentifier) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ImageQualityIdentifier) Msgsize added in v0.1.115

func (z ImageQualityIdentifier) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ImageQualityIdentifier) UnmarshalMsg added in v0.1.115

func (z *ImageQualityIdentifier) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Images

type Images struct {
	Backdrops []*Image `json:"backdrops"`
	Posters   []*Image `json:"posters"`
	Stills    []*Image `json:"stills"`
	Logos     []*Image `json:"logos"`
}

Images ...

func GetEpisodeImages

func GetEpisodeImages(showID, season, episode int) *Images

GetEpisodeImages ...

func GetImages

func GetImages(movieID int) *Images

GetImages ...

func GetSeasonImages

func GetSeasonImages(showID int, season int) *Images

GetSeasonImages ...

func GetShowImages

func GetShowImages(showID int) *Images

GetShowImages ...

func (*Images) MarshalMsg added in v0.1.115

func (z *Images) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Images) Msgsize added in v0.1.115

func (z *Images) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Images) UnmarshalMsg added in v0.1.115

func (z *Images) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Language

type Language struct {
	Iso639_1    string `json:"iso_639_1"`
	Name        string `json:"name"`
	EnglishName string `json:"english_name,omitempty"`
}

Language ...

func GetLanguages

func GetLanguages(language string) []*Language

GetLanguages ...

func (Language) MarshalMsg added in v0.1.115

func (z Language) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Language) Msgsize added in v0.1.115

func (z Language) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Language) UnmarshalMsg added in v0.1.115

func (z *Language) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type LanguageList

type LanguageList struct {
	Languages []*Language `json:"languages"`
}

LanguageList ...

func (*LanguageList) MarshalMsg added in v0.1.115

func (z *LanguageList) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*LanguageList) Msgsize added in v0.1.115

func (z *LanguageList) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*LanguageList) UnmarshalMsg added in v0.1.115

func (z *LanguageList) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type List

type List struct {
	CreatedBy     string    `json:"created_by"`
	Description   string    `json:"description"`
	FavoriteCount int       `json:"favorite_count"`
	ID            int       `json:"id"`
	ItemCount     int       `json:"item_count"`
	Iso639_1      string    `json:"iso_639_1"`
	Name          string    `json:"name"`
	PosterPath    string    `json:"poster_path"`
	Items         []*Entity `json:"items"`
}

List ...

func (*List) MarshalMsg added in v0.1.115

func (z *List) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*List) Msgsize added in v0.1.115

func (z *List) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*List) UnmarshalMsg added in v0.1.115

func (z *List) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Movie

type Movie struct {
	Entity

	FanArt              *fanart.Movie `json:"fanart"`
	IMDBId              string        `json:"imdb_id"`
	Popularity          float64       `json:"-"`
	ProductionCompanies []*IDNameLogo `json:"production_companies"`
	ProductionCountries []*Country    `json:"production_countries"`
	RawPopularity       any           `json:"popularity"`
	Runtime             int           `json:"runtime"`
	SpokenLanguages     []*Language   `json:"spoken_languages"`
	TagLine             string        `json:"tagline"`

	AlternativeTitles *struct {
		Titles []*AlternativeTitle `json:"titles"`
	} `json:"alternative_titles"`

	ReleaseDates *ReleaseDatesResults `json:"release_dates"`
}

Movie ...

func GetMovie

func GetMovie(tmdbID int, language string) *Movie

GetMovie ...

func GetMovieByID

func GetMovieByID(movieID string, language string) *Movie

GetMovieByID ...

func (*Movie) GetCountries

func (movie *Movie) GetCountries() []string

GetCountries returns list of countries

func (*Movie) GetGenres

func (movie *Movie) GetGenres() []string

GetGenres returns list of genres

func (*Movie) GetSearchTitle added in v0.1.110

func (movie *Movie) GetSearchTitle() string

func (*Movie) GetStudios

func (movie *Movie) GetStudios() []string

GetStudios returns list of studios

func (*Movie) GetTitle

func (movie *Movie) GetTitle() string

func (*Movie) MarshalMsg added in v0.1.115

func (z *Movie) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Movie) Msgsize added in v0.1.115

func (z *Movie) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Movie) SetArt

func (movie *Movie) SetArt(item *xbmc.ListItem)

SetArt sets artworks for movie

func (*Movie) ToListItem

func (movie *Movie) ToListItem() *xbmc.ListItem

ToListItem ...

func (*Movie) UnmarshalMsg added in v0.1.115

func (z *Movie) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Movie) Year

func (movie *Movie) Year() int

Year returns year of the movie

type Movies

type Movies []*Movie

Movies ...

func DiscoverMovies added in v0.1.115

func DiscoverMovies(params napping.Params, language string, page int) (Movies, int)

DiscoverMovies runs /discover/movie with caller-built filters and sorting

func GetIMDBList

func GetIMDBList(listID string, language string, page int) (movies Movies, totalResults int)

GetIMDBList ...

func GetMovies

func GetMovies(tmdbIds []int, language string) Movies

GetMovies ...

func MostVotedMovies

func MostVotedMovies(genre string, language string, page int) (Movies, int)

MostVotedMovies ...

func PopularMovies

func PopularMovies(params DiscoverFilters, language string, page int) (Movies, int)

PopularMovies ...

func RecentMovies

func RecentMovies(params DiscoverFilters, language string, page int) (Movies, int)

RecentMovies ...

func SearchMovies

func SearchMovies(query string, language string, page int) (Movies, int)

SearchMovies ...

func TopRatedMovies

func TopRatedMovies(genre string, language string, page int) (Movies, int)

TopRatedMovies ...

func (Movies) MarshalMsg added in v0.1.115

func (z Movies) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Movies) Msgsize added in v0.1.115

func (z Movies) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Movies) UnmarshalMsg added in v0.1.115

func (z *Movies) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ReleaseDate

type ReleaseDate struct {
	Certification string `json:"certification"`
	Iso639_1      string `json:"iso_639_1"`
	Note          string `json:"note"`
	ReleaseDate   string `json:"release_date"`
	Type          int    `json:"type"`
}

ReleaseDate ...

func (*ReleaseDate) MarshalMsg added in v0.1.115

func (z *ReleaseDate) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ReleaseDate) Msgsize added in v0.1.115

func (z *ReleaseDate) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReleaseDate) UnmarshalMsg added in v0.1.115

func (z *ReleaseDate) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ReleaseDates

type ReleaseDates struct {
	Iso3166_1    string         `json:"iso_3166_1"`
	ReleaseDates []*ReleaseDate `json:"release_dates"`
}

ReleaseDates ...

func (*ReleaseDates) MarshalMsg added in v0.1.115

func (z *ReleaseDates) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ReleaseDates) Msgsize added in v0.1.115

func (z *ReleaseDates) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReleaseDates) UnmarshalMsg added in v0.1.115

func (z *ReleaseDates) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ReleaseDatesResults

type ReleaseDatesResults struct {
	Results []*ReleaseDates `json:"results"`
}

ReleaseDatesResults ...

func (*ReleaseDatesResults) MarshalMsg added in v0.1.115

func (z *ReleaseDatesResults) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ReleaseDatesResults) Msgsize added in v0.1.115

func (z *ReleaseDatesResults) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ReleaseDatesResults) UnmarshalMsg added in v0.1.115

func (z *ReleaseDatesResults) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Season

type Season struct {
	Entity

	AirDate      string `json:"air_date"`
	EpisodeCount int    `json:"episode_count,omitempty"`
	Season       int    `json:"season_number"`

	Episodes EpisodeList `json:"episodes"`
}

Season ...

func GetSeason

func GetSeason(showID int, seasonNumber int, language string, seasonsCount int, includeEpisodes bool) *Season

GetSeason ...

func (*Season) CountEpisodesNumber

func (season *Season) CountEpisodesNumber(show *Show) (episodes int)

CountEpisodesNumber returns number of episodes

func (*Season) CountWatchedEpisodesNumber

func (season *Season) CountWatchedEpisodesNumber(show *Show) (watchedEpisodes int)

CountWatchedEpisodesNumber returns number of watched episodes

func (*Season) GetEpisode

func (season *Season) GetEpisode(episode int) *Episode

GetEpisode gets episode with specific number from Episodes list

func (*Season) GetFirstEpisodeNumber added in v0.1.112

func (season *Season) GetFirstEpisodeNumber() int

GetFirstEpisodeNumber returns the episode number of the first episode in the season.

func (*Season) GetName

func (season *Season) GetName(show *Show) string

func (*Season) GetSearchTitle added in v0.1.110

func (season *Season) GetSearchTitle(show *Show) string

func (*Season) HasEpisode

func (season *Season) HasEpisode(episode int) bool

HasEpisode checks if episode with specific number is available in the episodes list

func (*Season) MarshalMsg added in v0.1.115

func (z *Season) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Season) Msgsize added in v0.1.115

func (z *Season) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Season) SetArt

func (season *Season) SetArt(show *Show, item *xbmc.ListItem)

SetArt sets artworks for season

func (*Season) ToListItem

func (season *Season) ToListItem(show *Show) *xbmc.ListItem

ToListItem ...

func (*Season) UnmarshalMsg added in v0.1.115

func (z *Season) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SeasonList

type SeasonList []*Season

SeasonList ...

func (SeasonList) MarshalMsg added in v0.1.115

func (z SeasonList) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (SeasonList) Msgsize added in v0.1.115

func (z SeasonList) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (SeasonList) ToListItems

func (seasons SeasonList) ToListItems(show *Show) []*xbmc.ListItem

ToListItems ...

func (*SeasonList) UnmarshalMsg added in v0.1.115

func (z *SeasonList) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Show

type Show struct {
	Entity

	EpisodeRunTime      []int         `json:"episode_run_time"`
	FanArt              *fanart.Show  `json:"fanart"`
	Homepage            string        `json:"homepage"`
	InProduction        bool          `json:"in_production"`
	LastAirDate         string        `json:"last_air_date"`
	Networks            []*IDNameLogo `json:"networks"`
	NumberOfEpisodes    int           `json:"number_of_episodes"`
	NumberOfSeasons     int           `json:"number_of_seasons"`
	OriginCountry       []string      `json:"origin_country"`
	Popularity          float64       `json:"-"`
	ProductionCompanies []*IDNameLogo `json:"production_companies"`
	ProductionCountries []*Country    `json:"production_countries"`
	RawPopularity       any           `json:"popularity"`
	SpokenLanguages     []*Language   `json:"spoken_languages"`
	Status              string        `json:"status"`
	TagLine             string        `json:"tagline"`

	LastEpisodeToAir *Episode `json:"last_episode_to_air"`
	NextEpisodeToAir *Episode `json:"next_episode_to_air"`

	AlternativeTitles *struct {
		Titles []*AlternativeTitle `json:"results"`
	} `json:"alternative_titles"`

	ContentRatings *struct {
		Ratings []*ContentRating `json:"results"`
	} `json:"content_ratings"`

	Seasons SeasonList `json:"seasons"`
}

Show ...

func GetShow

func GetShow(showID int, language string) (show *Show)

GetShow ...

func GetShowByID

func GetShowByID(tmdbID string, language string) *Show

GetShowByID ...

func (*Show) CountEpisodesNumber

func (show *Show) CountEpisodesNumber() (episodes int)

CountEpisodesNumber returns number of episodes taking into account unaired and special

func (*Show) CountRealSeasons

func (show *Show) CountRealSeasons() int

CountRealSeasons counts real seasons, meaning without specials.

func (*Show) CountWatchedEpisodesNumber

func (show *Show) CountWatchedEpisodesNumber() (watchedEpisodes int)

CountWatchedEpisodesNumber returns number of watched episodes

func (*Show) EnsureSeason

func (show *Show) EnsureSeason(season int) *Season

func (*Show) EpisodesTillSeason

func (show *Show) EpisodesTillSeason(season int) int

EpisodesTillSeason counts how many episodes exist before this season.

func (*Show) GetCountries

func (show *Show) GetCountries() []string

GetCountries returns list of countries

func (*Show) GetGenres

func (show *Show) GetGenres() []string

GetGenres returns list of genres

func (*Show) GetName

func (show *Show) GetName() string

func (*Show) GetNetworks

func (show *Show) GetNetworks() []string

GetNetworks returns list of networks

func (*Show) GetProductionCompanies

func (show *Show) GetProductionCompanies() []string

GetProductionCompanies returns list of production companies

func (*Show) GetSeasonAirDate

func (show *Show) GetSeasonAirDate(season int) time.Time

func (*Show) GetSeasonByRealNumber

func (show *Show) GetSeasonByRealNumber(season int) *Season

GetSeasonByRealNumber returns season object corresponding to real season number.

func (*Show) GetSeasonEpisodes

func (show *Show) GetSeasonEpisodes(season int) int

GetSeasonEpisodes ...

func (*Show) GetStudios

func (show *Show) GetStudios() []string

GetStudios returns list of studios

func (*Show) IsAnime

func (show *Show) IsAnime() bool

IsAnime ...

func (*Show) IsSeasonAired

func (show *Show) IsSeasonAired(season int) bool

func (*Show) MarshalMsg added in v0.1.115

func (z *Show) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Show) Msgsize added in v0.1.115

func (z *Show) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Show) SetArt

func (show *Show) SetArt(item *xbmc.ListItem)

SetArt sets artworks for show

func (*Show) ShowInfo

func (show *Show) ShowInfo(episode *Episode) (an int, st string)

ShowInfo returns absolute episode number and show title

func (*Show) ShowInfoWithTVDBShow

func (show *Show) ShowInfoWithTVDBShow(episode *Episode, tvdbShow *tvdb.Show) (an int, st string)

ShowInfoWithTVDBShow ...

func (*Show) ToListItem

func (show *Show) ToListItem() *xbmc.ListItem

ToListItem ...

func (*Show) UnmarshalMsg added in v0.1.115

func (z *Show) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Shows

type Shows []*Show

Shows ...

func DiscoverShows added in v0.1.115

func DiscoverShows(params napping.Params, language string, page int) (Shows, int)

DiscoverShows runs /discover/tv with caller-built filters and sorting

func GetShows

func GetShows(showIds []int, language string) Shows

GetShows ...

func MostVotedShows

func MostVotedShows(genre string, language string, page int) (Shows, int)

MostVotedShows ...

func PopularShows

func PopularShows(params DiscoverFilters, language string, page int) (Shows, int)

PopularShows ...

func RecentEpisodes

func RecentEpisodes(params DiscoverFilters, language string, page int) (Shows, int)

RecentEpisodes ...

func RecentShows

func RecentShows(params DiscoverFilters, language string, page int) (Shows, int)

RecentShows ...

func SearchShows

func SearchShows(query string, language string, page int) (Shows, int)

SearchShows ...

func TopRatedShows

func TopRatedShows(genre string, language string, page int) (Shows, int)

TopRatedShows ...

func (Shows) MarshalMsg added in v0.1.115

func (z Shows) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Shows) Msgsize added in v0.1.115

func (z Shows) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Shows) UnmarshalMsg added in v0.1.115

func (z *Shows) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Trailer

type Trailer struct {
	Name string `json:"name"`
	Key  string `json:"key"`
	Type string `json:"type"`
	Site string `json:"site"`
}

Trailer ...

func (*Trailer) MarshalMsg added in v0.1.115

func (z *Trailer) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Trailer) Msgsize added in v0.1.115

func (z *Trailer) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Trailer) UnmarshalMsg added in v0.1.115

func (z *Trailer) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Translation

type Translation struct {
	Iso3166_1   string           `json:"iso_3166_1"`
	Iso639_1    string           `json:"iso_639_1"`
	Name        string           `json:"name"`
	EnglishName string           `json:"english_name"`
	Data        *TranslationData `json:"data"`
}

Translation ...

func (*Translation) MarshalMsg added in v0.1.115

func (z *Translation) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Translation) Msgsize added in v0.1.115

func (z *Translation) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Translation) UnmarshalMsg added in v0.1.115

func (z *Translation) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TranslationData

type TranslationData struct {
	Name     string `json:"name"`
	Title    string `json:"title"`
	Overview string `json:"overview"`
	Homepage string `json:"homepage"`
	TagLine  string `json:"tagline"`
}

TranslationData ...

func (*TranslationData) MarshalMsg added in v0.1.115

func (z *TranslationData) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TranslationData) Msgsize added in v0.1.115

func (z *TranslationData) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TranslationData) UnmarshalMsg added in v0.1.115

func (z *TranslationData) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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