Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAPIKey()
- func GetLocalizedImages(images []*Image, imageQuality ImageQualityIdentifier) (localizedImage string, allImages []string, imagesWithText []string, ...)
- func GetUserLanguages() (languagesList string)
- func ImageURL(uri string, size ImageQualityIdentifier) (imageURL string)
- func LogError(err error)
- func SetLocalizedArt(video *Entity, item *xbmc.ListItem)
- func SetTrailer(entity *Entity, item *xbmc.ListItem)
- type APIRequest
- type AlternativeTitle
- type ByPopularity
- type Cast
- type ContentRating
- type Country
- type CountryList
- type Credits
- type Crew
- type DiscoverFilters
- type Entity
- type EntityList
- type Episode
- func (episode *Episode) GetLowestAirDate(airDate string, airDateFormat string) (newAirDate string, newAirDateFormat string)
- func (episode *Episode) GetName(show *Show) string
- func (episode *Episode) SetArt(show *Show, season *Season, item *xbmc.ListItem)
- func (episode *Episode) ToListItem(show *Show, season *Season) *xbmc.ListItem
- type EpisodeList
- type ExternalIDs
- type FindResult
- type Genre
- type GenreList
- type IDName
- type IDNameLogo
- type Image
- type ImageQualityBundle
- type ImageQualityIdentifier
- 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
- func (season *Season) CountEpisodesNumber(show *Show) (episodes int)
- func (season *Season) CountWatchedEpisodesNumber(show *Show) (watchedEpisodes int)
- func (season *Season) GetEpisode(episode int) *Episode
- func (season *Season) GetName(show *Show) string
- func (season *Season) HasEpisode(episode int) bool
- func (season *Season) SetArt(show *Show, item *xbmc.ListItem)
- func (season *Season) ToListItem(show *Show) *xbmc.ListItem
- type SeasonList
- type Show
- func (show *Show) CountEpisodesNumber() (episodes int)
- func (show *Show) CountRealSeasons() int
- func (show *Show) CountWatchedEpisodesNumber() (watchedEpisodes int)
- func (show *Show) EnsureSeason(season int) *Season
- func (show *Show) EpisodesTillSeason(season int) int
- func (show *Show) GetCountries() []string
- func (show *Show) GetGenres() []string
- func (show *Show) GetName() string
- func (show *Show) GetNetworks() []string
- func (show *Show) GetProductionCompanies() []string
- func (show *Show) GetSeasonAirDate(season int) time.Time
- func (show *Show) GetSeasonByRealNumber(season int) *Season
- func (show *Show) GetSeasonEpisodes(season int) int
- func (show *Show) GetStudios() []string
- func (show *Show) IsAnime() bool
- func (show *Show) IsSeasonAired(season int) bool
- func (show *Show) SetArt(item *xbmc.ListItem)
- func (show *Show) ShowInfo(episode *Episode) (an int, st string)
- func (show *Show) ShowInfoWithTVDBShow(episode *Episode, tvdbShow *tvdb.Show) (an int, st string)
- func (show *Show) ToListItem() *xbmc.ListItem
- 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 = event.Event{} // Original High Medium Low ImageQualitiesPoster = []ImageQualityIdentifier{"original", "w780", "w500", "w342"} ImageQualitiesFanArt = []ImageQualityIdentifier{"original", "w1280", "w1280", "w780"} ImageQualitiesLogo = []ImageQualityIdentifier{"original", "w500", "w500", "w300"} ImageQualitiesThumbnail = []ImageQualityIdentifier{"original", "w1280", "w780", "w500"} ImageQualitiesLandscape = []ImageQualityIdentifier{"original", "w1280", "w780", "w500"} )
Functions ¶
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 SetLocalizedArt ¶
func SetTrailer ¶ added in v0.1.104
Types ¶
type APIRequest ¶
type APIRequest struct { URL string Params url.Values `msg:"-"` Result interface{} ErrMsg interface{} Description string }
APIRequest ...
type AlternativeTitle ¶
type AlternativeTitle struct { Iso3166_1 string `json:"iso_3166_1"` Title string `json:"title"` Type string `json:"type"` }
AlternativeTitle ...
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 ...
type ContentRating ¶
ContentRating ...
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 ...
type Credits ¶
Credits ...
func (*Credits) GetCastMembers ¶
func (credits *Credits) GetCastMembers() []xbmc.ListItemCastMember
GetCastMembers returns formatted cast members
func (*Credits) GetDirectors ¶
GetDirectors returns list of directors
func (*Credits) GetWriters ¶
GetWriters returns list of writers
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 ...
type DiscoverFilters ¶
DiscoverFilters ...
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 ...
type EntityList ¶
type EntityList struct { Page int `json:"page"` Results []*Entity `json:"results"` TotalPages int `json:"total_pages"` TotalResults int `json:"total_results"` }
EntityList ...
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 ¶
GetEpisode ...
func (*Episode) GetLowestAirDate ¶
type EpisodeList ¶
type EpisodeList []*Episode
EpisodeList ...
func (EpisodeList) ToListItems ¶
func (episodes EpisodeList) ToListItems(show *Show, season *Season) []*xbmc.ListItem
ToListItems ...
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 ...
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 ...
type IDNameLogo ¶
type IDNameLogo struct { ID int `json:"id"` Name string `json:"name"` Logo string `json:"logo_path"` OriginCountry string `json:"origin_country"` }
IDNameLogo ...
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 ...
type ImageQualityBundle ¶
type ImageQualityBundle struct { Poster ImageQualityIdentifier FanArt ImageQualityIdentifier Logo ImageQualityIdentifier Thumbnail ImageQualityIdentifier Landscape ImageQualityIdentifier }
ImageQualityBundle contains image qualities for different type of images
func GetImageQualities ¶
func GetImageQualities() (imageQualities ImageQualityBundle)
type ImageQualityIdentifier ¶
type ImageQualityIdentifier string
ImageQualityIdentifier contains the image quality as a string, e.g. "w1280"
type Images ¶
type Images struct { Backdrops []*Image `json:"backdrops"` Posters []*Image `json:"posters"` Stills []*Image `json:"stills"` Logos []*Image `json:"logos"` }
Images ...
func GetEpisodeImages ¶
GetEpisodeImages ...
type Language ¶
type Language struct { Iso639_1 string `json:"iso_639_1"` Name string `json:"name"` EnglishName string `json:"english_name,omitempty"` }
Language ...
type LanguageList ¶
type LanguageList struct {
Languages []*Language `json:"languages"`
}
LanguageList ...
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 ...
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 interface{} `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 (*Movie) GetCountries ¶
GetCountries returns list of countries
func (*Movie) GetStudios ¶
GetStudios returns list of studios
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 ...
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 ...
type ReleaseDates ¶
type ReleaseDates struct { Iso3166_1 string `json:"iso_3166_1"` ReleaseDates []*ReleaseDate `json:"release_dates"` }
ReleaseDates ...
type ReleaseDatesResults ¶
type ReleaseDatesResults struct {
Results []*ReleaseDates `json:"results"`
}
ReleaseDatesResults ...
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 ¶
CountEpisodesNumber returns number of episodes
func (*Season) CountWatchedEpisodesNumber ¶
CountWatchedEpisodesNumber returns number of watched episodes
func (*Season) GetEpisode ¶
GetEpisode gets episode with specific number from Episodes list
func (*Season) HasEpisode ¶
HasEpisode checks if episode with specific number is available in the episodes list
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) Swap ¶
func (seasons SeasonList) Swap(i, j int)
func (SeasonList) ToListItems ¶
func (seasons SeasonList) ToListItems(show *Show) []*xbmc.ListItem
ToListItems ...
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 interface{} `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 (*Show) CountEpisodesNumber ¶
CountEpisodesNumber returns number of episodes taking into account unaired and special
func (*Show) CountRealSeasons ¶
CountRealSeasons counts real seasons, meaning without specials.
func (*Show) CountWatchedEpisodesNumber ¶
CountWatchedEpisodesNumber returns number of watched episodes
func (*Show) EnsureSeason ¶
func (*Show) EpisodesTillSeason ¶
EpisodesTillSeason counts how many episodes exist before this season.
func (*Show) GetCountries ¶
GetCountries returns list of countries
func (*Show) GetNetworks ¶
GetNetworks returns list of networks
func (*Show) GetProductionCompanies ¶
GetProductionCompanies returns list of production companies
func (*Show) GetSeasonByRealNumber ¶
GetSeasonByRealNumber returns season object corresponding to real season number.
func (*Show) GetSeasonEpisodes ¶
GetSeasonEpisodes ...
func (*Show) GetStudios ¶
GetStudios returns list of studios
func (*Show) IsSeasonAired ¶
func (*Show) ShowInfoWithTVDBShow ¶
ShowInfoWithTVDBShow ...
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 ...
type Trailer ¶
type Trailer struct { Name string `json:"name"` Key string `json:"key"` Type string `json:"type"` Site string `json:"site"` }
Trailer ...
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 ...