Documentation ¶
Overview ¶
Package tvdb is a simple interface to the TVDB database of TV shows
Index ¶
- Variables
- type Actor
- type Auth
- type Conn
- func (c *Conn) Actors(id uint64) ([]Actor, error)
- func (c *Conn) AddFavorite(id uint64) error
- func (c *Conn) DVDSeasonEpisode(id uint64, season, episode uint64) (*SeriesEpisode, error)
- func (c *Conn) DVDSeasonEpisodes(id uint64, season uint64, page uint64) ([]SeriesEpisode, error)
- func (c *Conn) Episode(id uint64) (*Episode, error)
- func (c *Conn) Episodes(id uint64, page uint64) ([]SeriesEpisode, error)
- func (c *Conn) Favorites() ([]uint64, error)
- func (c *Conn) Language(id uint64) (*Language, error)
- func (c *Conn) Languages() ([]Language, error)
- func (c *Conn) Ratings() ([]Rating, error)
- func (c *Conn) RatingsByType(rit RatingItemType) ([]Rating, error)
- func (c *Conn) Refresh() error
- func (c *Conn) RemoveFavorite(id uint64) error
- func (c *Conn) RemoveRating(rit RatingItemType, id uint64) error
- func (c *Conn) Search(name string) ([]Search, error)
- func (c *Conn) SearchIMDB(imdb string) (*Search, error)
- func (c *Conn) SearchZap2It(zapit string) (*Search, error)
- func (c *Conn) SeasonEpisode(id uint64, season, episode uint64) (*SeriesEpisode, error)
- func (c *Conn) SeasonEpisodes(id uint64, season uint64, page uint64) ([]SeriesEpisode, error)
- func (c *Conn) Series(id uint64) (*Series, error)
- func (c *Conn) SeriesEpisode(id uint64, abs uint64) (*SeriesEpisode, error)
- func (c *Conn) SeriesSummary(id uint) (*Summary, error)
- func (c *Conn) SetLanguage(code string)
- func (c *Conn) SetRating(rit RatingItemType, id uint64, rating uint32) error
- func (c *Conn) Token() string
- func (c *Conn) User() (*User, error)
- type Episode
- type ErrInvalidFilters
- type ErrInvalidLanguage
- type ErrInvalidQueryParams
- type Language
- type Rating
- type RatingItemType
- type Search
- type Series
- type SeriesEpisode
- type Summary
- type User
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidAuth = errors.New("invalid credentials") ErrUnknownError = errors.New("unknown error") ErrNotFound = errors.New("not found") )
Errors
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { ID uint64 `json:"id"` SeriesID uint64 `json:"seriesId"` Name string `json:"name"` Role string `json:"role"` SortOrder uint `json:"sortOrder"` Image string `json:"image"` ImageAuthor uint64 `json:"imageAuthor"` ImageAdded string `json:"imageAdded"` LastUpdated string `json:"lastUpdated"` }
Actor represents all of the information about an actor in a show
type Auth ¶
type Auth struct { APIKey string `json:"apikey"` Username string `json:"username,omitempty"` UserKey string `json:"userkey,omitempty"` }
Auth represents the information required to get a validated authentication token.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a connection to the TVDB database
func (*Conn) AddFavorite ¶
AddFavorite adds a show id to the list of user favorites
func (*Conn) DVDSeasonEpisode ¶
func (c *Conn) DVDSeasonEpisode(id uint64, season, episode uint64) (*SeriesEpisode, error)
DVDSeasonEpisode returns the information about a particular episode in a series denoted by its DVD season and episode numbers
func (*Conn) DVDSeasonEpisodes ¶
DVDSeasonEpisodes returns a paginatied view (100 per page) of the episodes in the DVD season of a show
func (*Conn) Episode ¶
Episode returns the information about a single tv episode denoted by the episode id
func (*Conn) Episodes ¶
func (c *Conn) Episodes(id uint64, page uint64) ([]SeriesEpisode, error)
Episodes returns a paginated view (100 per page) of the episodes in a particular series
func (*Conn) Language ¶
Language retrieves information about a specific language, denoted by its language id
func (*Conn) RatingsByType ¶
func (c *Conn) RatingsByType(rit RatingItemType) ([]Rating, error)
RatingsByType returns a list of ratings for a specific type
func (*Conn) Refresh ¶
Refresh retrieves a new authentication token without having to use the login credentials. Each token only lasts 24 hours and refresh can only be used in that time-frame
func (*Conn) RemoveFavorite ¶
RemoveFavorite removes a show id to the list of user favorites
func (*Conn) RemoveRating ¶
func (c *Conn) RemoveRating(rit RatingItemType, id uint64) error
RemoveRating removes a user rating for a specific series, episode or banner
func (*Conn) SearchIMDB ¶
SearchIMDB searches the TVDB database for the show corrensponding to the given IMDB ID
func (*Conn) SearchZap2It ¶
SearchZap2It searches the TVDB database for the show corrensponding to the given Zap2It ID
func (*Conn) SeasonEpisode ¶
func (c *Conn) SeasonEpisode(id uint64, season, episode uint64) (*SeriesEpisode, error)
SeasonEpisode returns the information about a particular episode in a series denoted by its season and episode numbers
func (*Conn) SeasonEpisodes ¶
SeasonEpisodes returns a paginated view (100 per page) of the episodes in a season of a show
func (*Conn) SeriesEpisode ¶
func (c *Conn) SeriesEpisode(id uint64, abs uint64) (*SeriesEpisode, error)
SeriesEpisode returns the information about a particular episode in a series denoted by its absolute episode number
func (*Conn) SeriesSummary ¶
SeriesSummary returns the summary information about episodes for a tv show
func (*Conn) SetLanguage ¶
SetLanguage sets the language header used by some queries to return information in the requested language
type Episode ¶
type Episode struct { ID uint64 `json:"id"` AiredSeason uint `json:"airedSeason"` AiredSeasonID uint64 `json:"airedSeasonId"` AiredEpisodeNumber uint `json:"airedEpisodeNumber"` Name string `json:"episodeName"` FirstAired string `json:"firstAired"` GuestStars []string `json:"guestStars"` Directors []string `json:"directors"` Writers []string `json:"writers"` Overview string `json:"overview"` Language struct { EpisodeName string `json:"episodeName"` Overview string `json:"overview"` } `json:"language"` ProductionCode string `json:"productionCode"` ShowURL string `json:"shorUrl"` LastUpdated int64 `json:"lastUpdated"` DVDDiscID string `json:"dvdDiscid"` DVDSeason uint `json:"dvdSeason"` DVDEpisodeNumber uint `json:"dvdEpisodeNumber"` DVDChapter uint `json:"dvdChapter"` AbsoluteNumber uint `json:"absoluteNumber"` Filename string `json:"filename"` SeriesID uint64 `json:"seriesId"` LastUpdatedBy uint64 `json:"lastUpdatedBy"` AirsAfterSeason uint `json:"airsAfterSeason"` AirsBeforeSeason uint `json:"airsBeforeSeason"` AirsBeforeEpisode uint `json:"airsBeforeEpisode"` ThumbAuthor uint64 `json:"thumbAuthor"` ThumbAdded string `json:"thumbAdded"` ThumbWidth string `json:"thumbWidth"` ThumbHeight string `json:"thumbHeight"` IMDBID string `json:"imdbId"` SiteRating float32 `json:"siteRating"` SiteRatingCount uint64 `json:"siteRatingCount"` }
Episode represents the data for a single episode of a programme
type ErrInvalidFilters ¶
type ErrInvalidFilters []string
ErrInvalidFilters is returned from query that use an unknown or invalid filter
func (ErrInvalidFilters) Error ¶
func (ErrInvalidFilters) Error() string
Error satisfies the error interface
func (ErrInvalidFilters) UnmarshalJSON ¶
func (ErrInvalidFilters) UnmarshalJSON(b []byte) error
UnmarshalJSON uses the json decoding of the error to generate an error instead of decoding
type ErrInvalidLanguage ¶
type ErrInvalidLanguage string
ErrInvalidLanguage is returned when a query requests an unknown or invalid language
func (ErrInvalidLanguage) Error ¶
func (ErrInvalidLanguage) Error() string
Error satisfies the error interface
func (ErrInvalidLanguage) UnmarshalJSON ¶
func (ErrInvalidLanguage) UnmarshalJSON(b []byte) error
UnmarshalJSON uses the json decoding of the error to generate an error instead of decoding
type ErrInvalidQueryParams ¶
type ErrInvalidQueryParams []string
ErrInvalidQueryParams is returned when a query uses unknown or invalid params
func (ErrInvalidQueryParams) Error ¶
func (ErrInvalidQueryParams) Error() string
Error satisfies the error interface
func (ErrInvalidQueryParams) UnmarshalJSON ¶
func (ErrInvalidQueryParams) UnmarshalJSON(b []byte) error
UnmarshalJSON uses the json decoding of the error to generate an error instead of decoding
type Language ¶
type Language struct { ID uint64 `json:"id"` Abbreviation string `json:"abbreviation"` Name string `json:"name"` EnglishName string `json:"englishName"` }
Language contains information about a supported language
type Rating ¶
type Rating struct { Type string `json:"ratingType"` ItemID uint64 `json:"ratingItemId"` Rating float32 `json:"rating"` }
Rating represents a single rating for an item
type RatingItemType ¶
type RatingItemType string
RatingItemType represents the type of rating, currently one of series, episode and banner
const ( RatingSeries RatingItemType = "series" RatingEpisode RatingItemType = "episode" RatingBanner RatingItemType = "banner" )
The currently available Item Types for Rating
type Search ¶
type Search struct { Aliases []string `json:"aliases"` Banner string `json:"banner"` FirstAired string `json:"firstAired"` ID uint64 `json:"id"` Network string `json:"network"` Overview string `json:"overview"` Name string `json:"seriesName"` Status string `json:"status"` }
Search is a representation of the data returned from a tv show search
type Series ¶
type Series struct { ID uint64 `json:"id"` Name string `json:"seriesName"` Aliases []string `json:"aliases"` Banner string `json:"banner"` SeriesID string `json:"seriesId"` Status string `json:"status"` FirstAired string `json:"firstAired"` Network string `json:"network"` NetworkID string `json:"networkId"` Runtime string `json:"runtime"` Genre []string `json:"genre"` Overview string `json:"overview"` LastUpdated uint64 `json:"lastUpdated"` AirsDayOfWeek string `json:"airsDayOfWeek"` AirsTime string `json:"airsTime"` Rating string `json:"rating"` IMDBID string `json:"imdbId"` Zap2ItID string `json:"zap2ItId"` Added string `json:"added"` SiteRating float32 `json:"siteRating"` SiteRatingCount uint64 `json:"siteRatingCount"` }
Series represents all of the information about a particular show
type SeriesEpisode ¶
type SeriesEpisode struct { AbsoluteNumber uint `json:"absoluteNumber"` AiredEpisodeNumber uint `json:"airedEpisodeNumber"` AiredSeason uint `json:"airedSeason"` DVDEpisodeNumber float32 `json:"dvdEpisodeNumber"` DVDSeason uint `json:"dvdSeason"` Name string `json:"episodeName"` ID uint64 `json:"id"` Overview string `json:"overview"` FirstAired string `json:"firstAired"` LastUpdated uint64 `json:"lastUpdated"` }
SeriesEpisode represents all of the information about a particular episode of a show