Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAPIKey()
- func ImageURL(uri string, size string) string
- func LogError(err error)
- func MakeRequest(r APIRequest) (ret error)
- type APIRequest
- type AlternativeTitle
- type ByPopularity
- type Cast
- type Country
- type CountryList
- type Credits
- type Crew
- type DiscoverFilters
- type Entity
- type EntityList
- type Episode
- type EpisodeList
- type ExternalIDs
- type FindResult
- type Genre
- type GenreList
- type IDName
- type Image
- type Images
- type Language
- type LanguageList
- type List
- type Movie
- type Movies
- func GetIMDBList(listID string, language string, page int) (movies Movies, totalResults int)
- func GetMovies(tmdbIds []int, language string) Movies
- func MostVotedMovies(genre string, language string, page int) (Movies, int)
- func PopularMovies(params DiscoverFilters, language string, page int) (Movies, int)
- func RecentMovies(params DiscoverFilters, language string, page int) (Movies, int)
- func SearchMovies(query string, language string, page int) (Movies, int)
- func TopRatedMovies(genre string, language string, page int) (Movies, int)
- type ReleaseDate
- type ReleaseDates
- type ReleaseDatesResults
- type Season
- type SeasonList
- func (seasons SeasonList) Len() int
- func (seasons SeasonList) Less(i, j int) bool
- func (z SeasonList) MarshalMsg(b []byte) (o []byte, err error)
- func (z SeasonList) Msgsize() (s int)
- func (seasons SeasonList) Swap(i, j int)
- func (seasons SeasonList) ToListItems(show *Show) []*xbmc.ListItem
- func (z *SeasonList) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Show
- func (show *Show) AnimeInfo(episode *Episode) (an int, st string)
- func (show *Show) AnimeInfoWithShow(episode *Episode, tvdbShow *tvdb.Show) (an int, st string)
- func (show *Show) GetSeasonEpisodes(season int) int
- func (show *Show) IsAnime() bool
- func (z *Show) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Show) Msgsize() (s int)
- func (show *Show) ToListItem() *xbmc.ListItem
- func (z *Show) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Shows
- func GetShows(showIds []int, language string) Shows
- func MostVotedShows(genre string, language string, page int) (Shows, int)
- func PopularShows(params DiscoverFilters, language string, page int) (Shows, int)
- func RecentEpisodes(params DiscoverFilters, language string, page int) (Shows, int)
- func RecentShows(params DiscoverFilters, language string, page int) (Shows, int)
- func SearchShows(query string, language string, page int) (Shows, int)
- func TopRatedShows(genre string, language string, page int) (Shows, int)
- type Trailer
- type Translation
- type TranslationData
Constants ¶
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 ¶
var ( // WarmingUp ... WarmingUp = util.Event{} )
Functions ¶
func MakeRequest ¶
func MakeRequest(r APIRequest) (ret error)
MakeRequest used to proxy requests with proper RateLimiter usage and HTTP error processing
Types ¶
type APIRequest ¶
type APIRequest struct {
URL string
Params url.Values `msg:"-"`
Result interface{}
ErrMsg interface{}
Description string
}
APIRequest ...
func (*APIRequest) MarshalMsg ¶
func (z *APIRequest) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*APIRequest) Msgsize ¶
func (z *APIRequest) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*APIRequest) UnmarshalMsg ¶
func (z *APIRequest) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type AlternativeTitle ¶
AlternativeTitle ...
func (AlternativeTitle) MarshalMsg ¶
func (z AlternativeTitle) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (AlternativeTitle) Msgsize ¶
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 ¶
func (z *AlternativeTitle) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type ByPopularity ¶
type ByPopularity Movies
ByPopularity ...
func (ByPopularity) Len ¶
func (a ByPopularity) Len() int
func (ByPopularity) Less ¶
func (a ByPopularity) Less(i, j int) bool
func (ByPopularity) Swap ¶
func (a ByPopularity) Swap(i, j int)
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 (*Cast) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Country ¶
type Country struct {
Iso31661 string `json:"iso_3166_1"`
EnglishName string `json:"english_name"`
}
Country ...
func (Country) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type CountryList ¶
type CountryList []*Country
CountryList ...
func (CountryList) MarshalMsg ¶
func (z CountryList) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (CountryList) Msgsize ¶
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 ¶
func (z *CountryList) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Credits ¶
Credits ...
func (*Credits) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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 ¶
MarshalMsg implements msgp.Marshaler
type DiscoverFilters ¶
DiscoverFilters ...
func (DiscoverFilters) MarshalMsg ¶
func (z DiscoverFilters) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (DiscoverFilters) Msgsize ¶
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 ¶
func (z *DiscoverFilters) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Entity ¶
type Entity struct {
IsAdult bool `json:"adult"`
BackdropPath string `json:"backdrop_path"`
ID int `json:"id"`
Genres []*IDName `json:"genres"`
OriginalTitle string `json:"original_title,omitempty"`
OriginalLanguage string `json:"original_language,omitempty"`
ReleaseDate string `json:"release_date"`
FirstAirDate string `json:"first_air_date"`
PosterPath string `json:"poster_path"`
Title string `json:"title,omitempty"`
VoteAverage float32 `json:"vote_average"`
VoteCount int `json:"vote_count"`
OriginalName string `json:"original_name,omitempty"`
Name string `json:"name,omitempty"`
}
Entity ...
func (*Entity) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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 ¶
func (z *EntityList) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*EntityList) Msgsize ¶
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 ¶
func (z *EntityList) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Episode ¶
type Episode struct {
ID int `json:"id"`
Name string `json:"name"`
Overview string `json:"overview"`
AirDate string `json:"air_date"`
SeasonNumber int `json:"season_number"`
EpisodeNumber int `json:"episode_number"`
VoteAverage float32 `json:"vote_average"`
StillPath string `json:"still_path"`
ExternalIDs *ExternalIDs `json:"external_ids"`
AlternativeTitles *struct {
Titles []*AlternativeTitle `json:"titles"`
} `json:"alternative_titles"`
Translations *struct {
Translations []*Translation `json:"translations"`
} `json:"translations"`
Trailers *struct {
Youtube []*Trailer `json:"youtube"`
} `json:"trailers"`
Credits *Credits `json:"credits,omitempty"`
Images *Images `json:"images,omitempty"`
}
Episode ...
func GetEpisode ¶
GetEpisode ...
func (*Episode) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Episode) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Episode) ToListItem ¶
ToListItem ...
type EpisodeList ¶
type EpisodeList []*Episode
EpisodeList ...
func (EpisodeList) MarshalMsg ¶
func (z EpisodeList) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (EpisodeList) Msgsize ¶
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 ¶
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 interface{} `json:"tvdb_id"`
}
ExternalIDs ...
func (*ExternalIDs) MarshalMsg ¶
func (z *ExternalIDs) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ExternalIDs) Msgsize ¶
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 ¶
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 (*FindResult) MarshalMsg ¶
func (z *FindResult) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*FindResult) Msgsize ¶
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 ¶
func (z *FindResult) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Genre ¶
type Genre IDName
Genre ...
func (Genre) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type GenreList ¶
type GenreList struct {
Genres []*Genre `json:"genres"`
}
GenreList ...
func (*GenreList) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type IDName ¶
IDName ...
func (IDName) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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 ¶
MarshalMsg implements msgp.Marshaler
type Images ¶
type Images struct {
Backdrops []*Image `json:"backdrops"`
Posters []*Image `json:"posters"`
Stills []*Image `json:"stills"`
}
Images ...
func GetEpisodeImages ¶
GetEpisodeImages ...
func (*Images) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Language ¶
type Language struct {
Iso639_1 string `json:"iso_639_1"`
Name string `json:"name"`
EnglishName string `json:"english_name,omitempty"`
}
Language ...
func (Language) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type LanguageList ¶
type LanguageList struct {
Languages []*Language `json:"languages"`
}
LanguageList ...
func (*LanguageList) MarshalMsg ¶
func (z *LanguageList) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*LanguageList) Msgsize ¶
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 ¶
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 string `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 ¶
MarshalMsg implements msgp.Marshaler
type Movie ¶
type Movie struct {
Entity
IMDBId string `json:"imdb_id"`
Overview string `json:"overview"`
ProductionCompanies []*IDName `json:"production_companies"`
Runtime int `json:"runtime"`
TagLine string `json:"tagline"`
RawPopularity interface{} `json:"popularity"`
Popularity float64 `json:"-"`
SpokenLanguages []*Language `json:"spoken_languages"`
ExternalIDs *ExternalIDs `json:"external_ids"`
AlternativeTitles *struct {
Titles []*AlternativeTitle `json:"titles"`
} `json:"alternative_titles"`
Translations *struct {
Translations []*Translation `json:"translations"`
} `json:"translations"`
Trailers *struct {
Youtube []*Trailer `json:"youtube"`
} `json:"trailers"`
Credits *Credits `json:"credits,omitempty"`
Images *Images `json:"images,omitempty"`
ReleaseDates *ReleaseDatesResults `json:"release_dates"`
}
Movie ...
func (*Movie) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Movie) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Movie) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
type Movies ¶
type Movies []*Movie
Movies ...
func GetIMDBList ¶
GetIMDBList ...
func MostVotedMovies ¶
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 ¶
SearchMovies ...
func TopRatedMovies ¶
TopRatedMovies ...
func (Movies) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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 ¶
func (z *ReleaseDate) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ReleaseDate) Msgsize ¶
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 ¶
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 ¶
func (z *ReleaseDates) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ReleaseDates) Msgsize ¶
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 ¶
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 ¶
func (z *ReleaseDatesResults) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ReleaseDatesResults) Msgsize ¶
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 ¶
func (z *ReleaseDatesResults) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Season ¶
type Season struct {
ID int `json:"id"`
Name string `json:"name,omitempty"`
Season int `json:"season_number"`
EpisodeCount int `json:"episode_count,omitempty"`
AirDate string `json:"air_date"`
Poster string `json:"poster_path"`
ExternalIDs *ExternalIDs `json:"external_ids"`
AlternativeTitles *struct {
Titles []*AlternativeTitle `json:"titles"`
} `json:"alternative_titles"`
Translations *struct {
Translations []*Translation `json:"translations"`
} `json:"translations"`
Trailers *struct {
Youtube []*Trailer `json:"youtube"`
} `json:"trailers"`
Credits *Credits `json:"credits,omitempty"`
Images *Images `json:"images,omitempty"`
Episodes EpisodeList `json:"episodes"`
}
Season ...
func (*Season) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Season) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Season) ToListItem ¶
ToListItem ...
type SeasonList ¶
type SeasonList []*Season
SeasonList ...
func (SeasonList) Len ¶
func (seasons SeasonList) Len() int
func (SeasonList) Less ¶
func (seasons SeasonList) Less(i, j int) bool
func (SeasonList) MarshalMsg ¶
func (z SeasonList) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (SeasonList) Msgsize ¶
func (z SeasonList) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (SeasonList) Swap ¶
func (seasons SeasonList) Swap(i, j int)
func (SeasonList) ToListItems ¶
func (seasons SeasonList) ToListItems(show *Show) []*xbmc.ListItem
ToListItems ...
func (*SeasonList) UnmarshalMsg ¶
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"`
Homepage string `json:"homepage"`
InProduction bool `json:"in_production"`
LastAirDate string `json:"last_air_date"`
Networks []*IDName `json:"networks"`
NumberOfEpisodes int `json:"number_of_episodes"`
NumberOfSeasons int `json:"number_of_seasons"`
OriginCountry []string `json:"origin_country"`
Overview string `json:"overview"`
RawPopularity interface{} `json:"popularity"`
Popularity float64 `json:"-"`
ProductionCompanies []*IDName `json:"production_companies"`
Status string `json:"status"`
ExternalIDs *ExternalIDs `json:"external_ids"`
Translations *struct {
Translations []*Translation `json:"translations"`
} `json:"translations"`
AlternativeTitles *struct {
Titles []*AlternativeTitle `json:"results"`
} `json:"alternative_titles"`
Credits *Credits `json:"credits,omitempty"`
Images *Images `json:"images,omitempty"`
Seasons SeasonList `json:"seasons"`
}
Show ...
func (*Show) AnimeInfoWithShow ¶
AnimeInfoWithShow ...
func (*Show) GetSeasonEpisodes ¶
GetSeasonEpisodes ...
func (*Show) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Shows ¶
type Shows []*Show
Shows ...
func MostVotedShows ¶
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 ¶
SearchShows ...
func TopRatedShows ¶
TopRatedShows ...
func (Shows) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Trailer ¶
type Trailer struct {
Name string `json:"name"`
Size string `json:"size"`
Source string `json:"source"`
Type string `json:"type"`
}
Trailer ...
func (*Trailer) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
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 ¶
func (z *Translation) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*Translation) Msgsize ¶
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 ¶
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"`
}
TranslationData ...
func (*TranslationData) MarshalMsg ¶
func (z *TranslationData) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*TranslationData) Msgsize ¶
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 ¶
func (z *TranslationData) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler