internal

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal abc

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Package internal used for client and services

Index

Constants

View Source
const (
	HeaderPaginationPage                 = "X-Pagination-Page"
	HeaderPaginationPageCount            = "X-Pagination-Page-Count"
	HeaderRateLimit                      = "X-RateLimit"
	HeaderRetryAfter                     = "Retry-After"
	HeaderUpgradeURL                     = "X-Upgrade-URL"
	TimezoneKey               contextKey = "timezone"
	Version                              = "2"
)

basic consts for client

Variables

This section is empty.

Functions

This section is empty.

Types

type AbuseRateLimitError

type AbuseRateLimitError struct {
	Response   *http.Response
	RetryAfter *time.Duration
	Message    string `json:"message"`
}

AbuseRateLimitError occurs when trakt.tv returns 429 too many requests header

func (*AbuseRateLimitError) Error

func (r *AbuseRateLimitError) Error() string

type BadRequestError added in v1.11.0

type BadRequestError struct {
	Response *http.Response
	Message  string `json:"message"`
}

BadRequestError occurs when trakt.tv returns 400 error

func (*BadRequestError) Error added in v1.11.0

func (r *BadRequestError) Error() string

type CalendarsService

type CalendarsService Service

CalendarsService handles communication with the calendars related methods of the Trakt API.

func (*CalendarsService) GetDVDReleases

func (c *CalendarsService) GetDVDReleases(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)

GetDVDReleases Returns all movies with a DVD release date during the time period specified.

API docs: https://trakt.docs.apiary.io/#reference/calendars/my-dvd/get-dvd-releases API docs: https://trakt.docs.apiary.io/#reference/calendars/all-dvd/get-dvd-releases

func (*CalendarsService) GetFinales

func (c *CalendarsService) GetFinales(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)

GetFinales Returns all show finales (mid_season_finale, season_finale, series_finale) airing during the time period specified.

API docs: https://trakt.docs.apiary.io/#reference/calendars/my-finales/get-finales API docs: https://trakt.docs.apiary.io/#reference/calendars/all-finales/get-finales

func (*CalendarsService) GetMovies

func (c *CalendarsService) GetMovies(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)

GetMovies Returns all movies with a release date during the time period specified.

API docs: https://trakt.docs.apiary.io/#reference/calendars/my-movies/get-movies API docs: https://trakt.docs.apiary.io/#reference/calendars/all-movies/get-movies

func (*CalendarsService) GetNewShows

func (c *CalendarsService) GetNewShows(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)

GetNewShows Returns all new show premieres airing during the time period specified.

API docs: https://trakt.docs.apiary.io/#reference/calendars/my-new-shows/get-new-shows API docs: https://trakt.docs.apiary.io/#reference/calendars/all-new-shows/get-new-shows

func (*CalendarsService) GetSeasonPremieres

func (c *CalendarsService) GetSeasonPremieres(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)

GetSeasonPremieres Returns all show premieres (mid_season_premiere, season_premiere, series_premiere) airing during the time period specified.

API docs: https://trakt.docs.apiary.io/#reference/calendars/my-season-premieres/get-season-premieres API docs: https://trakt.docs.apiary.io/#reference/calendars/all-season-premieres/get-season-premieres

func (*CalendarsService) GetShows

func (c *CalendarsService) GetShows(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)

GetShows Returns all shows airing during the time period specified.

API docs: https://trakt.docs.apiary.io/#reference/calendars/my-shows/get-shows API docs: https://trakt.docs.apiary.io/#reference/calendars/all-shows/get-shows

type CertificationsService added in v1.6.0

type CertificationsService Service

CertificationsService handles communication with the certifications related methods of the Trakt API.

func (*CertificationsService) GetCertifications added in v1.6.0

func (c *CertificationsService) GetCertifications(ctx context.Context, strType *string) (*str.Certifications, *str.Response, error)

GetCertifications Get a list of all certifications, including names, slugs, and descriptions.

API docs: https://trakt.docs.apiary.io/#reference/certifications/list/get-certifications

type CheckinService added in v1.5.0

type CheckinService Service

CheckinService handles communication with the checkin related methods of the Trakt API.

func (*CheckinService) CheckintoAnItem added in v1.5.0

func (c *CheckinService) CheckintoAnItem(ctx context.Context, checkin *str.Checkin) (*str.Checkin, *str.Response, error)

CheckintoAnItem Check into a movie or episode.

API docs: https://trakt.docs.apiary.io/#reference/checkin/checkin/check-into-an-item

func (*CheckinService) DeleteAnyActiveCheckins added in v1.5.0

func (c *CheckinService) DeleteAnyActiveCheckins(ctx context.Context) (*str.Response, error)

DeleteAnyActiveCheckins Removes any active checkins, no need to provide a specific item.

API docs: https://trakt.docs.apiary.io/#reference/checkin/checkin/delete-any-active-checkins

type Client

type Client struct {
	RateLimitReset time.Time

	BaseURL    *url.URL
	UpgradeURL *url.URL

	Oauth           *OauthService
	Users           *UsersService
	Sync            *SyncService
	People          *PeopleService
	Calendars       *CalendarsService
	Certifications  *CertificationsService
	Countries       *CountriesService
	Checkin         *CheckinService
	Comments        *CommentsService
	Genres          *GenresService
	Search          *SearchService
	Languages       *LanguagesService
	Lists           *ListsService
	Movies          *MoviesService
	Networks        *NetworksService
	Notes           *NotesService
	Episodes        *EpisodesService
	Recommendations *RecommendationsService
	Shows           *ShowsService
	Scrobble        *ScrobbleService
	Seasons         *SeasonsService
	// contains filtered or unexported fields
}

A Client manages communication with the trakt.tv API.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new API client. If a nil httpClient is provided, a new http.Client will be used.

func (*Client) AdjustTimestamps added in v1.11.0

func (c *Client) AdjustTimestamps(val reflect.Value, loc *time.Location)

AdjustTimestamps update timestamps with user timezone

func (*Client) BareDo

func (c *Client) BareDo(ctx context.Context, req *http.Request) (*str.Response, error)

BareDo sends an API request and lets you handle the api response.

func (*Client) BuildCtxFromOptions added in v1.11.0

func (*Client) BuildCtxFromOptions(options *str.Options) context.Context

BuildCtxFromOptions create ctx with custom options

func (*Client) CheckResponse

func (c *Client) CheckResponse(r *http.Response) error

CheckResponse checks if api response have errors.

func (*Client) CheckRetryAfter

func (c *Client) CheckRetryAfter(req *http.Request) *AbuseRateLimitError

CheckRetryAfter check Retry After header.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*str.Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred

func (*Client) GetHeaders added in v1.11.0

func (c *Client) GetHeaders() map[string]any

GetHeaders is for get headers map

func (*Client) GetTimezone added in v1.11.0

func (*Client) GetTimezone(ctx context.Context) *time.Location

GetTimezone to get timezone from ctx object

func (*Client) HavePages added in v1.0.3

func (*Client) HavePages(page int, resp *str.Response, limit int) bool

HavePages checks if we have available pages to fetch

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error)

NewRequest creates an API request.

func (*Client) NewResponse

func (c *Client) NewResponse(r *http.Response) *str.Response

NewResponse creates a new Response for the provided http.Response. r must not be nil.

func (*Client) ParseRate

func (*Client) ParseRate(r *http.Response) str.Rate

ParseRate parses the rate related headers.

func (*Client) ParseRateLimit

func (*Client) ParseRateLimit(r *http.Response) *time.Duration

ParseRateLimit parses related headers, and returns the time to retry after.

func (*Client) ParseUpgradeUser added in v1.1.0

func (*Client) ParseUpgradeUser(r *http.Response) *url.URL

ParseUpgradeUser parses related headers, and returns upgradeUrl.

func (*Client) UpdateHeaders

func (c *Client) UpdateHeaders(headers map[string]any)

UpdateHeaders is for update client headers map

func (*Client) WithContext

func (*Client) WithContext(ctx context.Context, req *http.Request) *http.Request

WithContext pass context to request

type CommentsService added in v1.6.0

type CommentsService Service

CommentsService handles communication with the comments related methods of the Trakt API.

func (*CommentsService) DeleteComment added in v1.6.0

func (c *CommentsService) DeleteComment(ctx context.Context, id *int) (*str.Response, error)

DeleteComment to delete a single comment. API docs: https://trakt.docs.apiary.io/#reference/comments/comment/delete-a-comment-or-reply

func (*CommentsService) GetComment added in v1.6.0

func (c *CommentsService) GetComment(ctx context.Context, id *int) (*str.Comment, *str.Response, error)

GetComment Returns comment object.

func (*CommentsService) GetCommentItem added in v1.6.0

func (c *CommentsService) GetCommentItem(ctx context.Context, id *int, opts *uri.ListOptions) (*str.CommentMediaItem, *str.Response, error)

GetCommentItem Returns comment media item object. API docs: https://trakt.docs.apiary.io/#reference/comments/item/get-the-attached-media-item

func (*CommentsService) GetCommentUserLikes added in v1.6.0

func (c *CommentsService) GetCommentUserLikes(ctx context.Context, id *int, opts *uri.ListOptions) ([]*str.CommentUserLike, *str.Response, error)

GetCommentUserLikes Returns all users who liked a comment. API docs: https://trakt.docs.apiary.io/#reference/comments/item/get-all-users-who-liked-a-comment

func (*CommentsService) GetRecentComments added in v1.6.0

func (c *CommentsService) GetRecentComments(ctx context.Context, contentType *string, strType *string, opts *uri.ListOptions) ([]*str.CommentItem, *str.Response, error)

GetRecentComments Returns the most recently written comments across all of Trakt. API docs: https://trakt.docs.apiary.io/#reference/comments/recent/get-recently-created-comments

func (*CommentsService) GetRepliesForComment added in v1.6.0

func (c *CommentsService) GetRepliesForComment(ctx context.Context, opts *uri.ListOptions, id *int) ([]*str.Comment, *str.Response, error)

GetRepliesForComment Returns all replies for a comment. API docs: https://trakt.docs.apiary.io/#reference/comments/replies/get-replies-for-a-comment

func (*CommentsService) GetTrendingComments added in v1.6.0

func (c *CommentsService) GetTrendingComments(ctx context.Context, contentType *string, strType *string, opts *uri.ListOptions) ([]*str.CommentItem, *str.Response, error)

GetTrendingComments Returns all comments with the most likes and replies over the last 7 days. API docs: https://trakt.docs.apiary.io/#reference/comments/trending/get-trending-comments

func (*CommentsService) GetUpdatedComments added in v1.6.0

func (c *CommentsService) GetUpdatedComments(ctx context.Context, contentType *string, strType *string, opts *uri.ListOptions) ([]*str.CommentItem, *str.Response, error)

GetUpdatedComments Returns the most recently updated comments across all of Trakt. API docs: https://trakt.docs.apiary.io/#reference/comments/updates/get-recently-updated-comments

func (*CommentsService) LikeComment added in v1.6.0

func (c *CommentsService) LikeComment(ctx context.Context, id *int) (*str.Response, error)

LikeComment Votes help determine popular comments. Only one like is allowed per comment per user.

API docs: https://trakt.docs.apiary.io/#reference/comments/like/like-a-comment

func (*CommentsService) PostAComment added in v1.6.0

func (c *CommentsService) PostAComment(ctx context.Context, comment *str.Comment) (*str.Comment, *str.Response, error)

PostAComment Add a new comment to a movie, show, season, episode, or list.

API docs:https://trakt.docs.apiary.io/#reference/comments/comments/post-a-comment

func (*CommentsService) RemoveLikeComment added in v1.6.0

func (c *CommentsService) RemoveLikeComment(ctx context.Context, id *int) (*str.Response, error)

RemoveLikeComment Remove a like on a comment.

API docs: https://trakt.docs.apiary.io/#reference/comments/like/remove-like-on-a-comment

func (*CommentsService) ReplyAComment added in v1.6.0

func (c *CommentsService) ReplyAComment(ctx context.Context, id *int, reply *str.Comment) (*str.Comment, *str.Response, error)

ReplyAComment Add a new reply to an existing comment. API docs:https://trakt.docs.apiary.io/#reference/comments/replies/post-a-reply-for-a-comment

func (*CommentsService) UpdateComment added in v1.6.0

func (c *CommentsService) UpdateComment(ctx context.Context, id *int, comment *str.Comment) (*str.Comment, *str.Response, error)

UpdateComment to update a single comment. API docs: https://trakt.docs.apiary.io/#reference/comments/comment/update-a-comment-or-reply

type ConflictError added in v1.5.0

type ConflictError struct {
	Response *http.Response
	Message  string `json:"message"`
}

ConflictError occurs when trakt.tv returns 409 error

func (*ConflictError) Error added in v1.5.0

func (r *ConflictError) Error() string

type CountriesService added in v1.7.0

type CountriesService Service

CountriesService handles communication with the countries related methods of the Trakt API.

func (*CountriesService) GetCountries added in v1.7.0

func (c *CountriesService) GetCountries(ctx context.Context, strType *string) ([]*str.Country, *str.Response, error)

GetCountries Get a list of all countries, including names and codes.

API docs: https://trakt.docs.apiary.io/#reference/countries/list/get-countries

type EpisodesService added in v1.5.0

type EpisodesService Service

EpisodesService handles communication with the episodes related methods of the Trakt API.

func (*EpisodesService) GetEpisode added in v1.5.0

func (m *EpisodesService) GetEpisode(ctx context.Context, id *string) (*str.Episode, *str.Response, error)

GetEpisode Returns episode object.

type GenresService added in v1.7.0

type GenresService Service

GenresService handles communication with the genres related methods of the Trakt API.

func (*GenresService) GetGenres added in v1.7.0

func (g *GenresService) GetGenres(ctx context.Context, strType *string) ([]*str.Genre, *str.Response, error)

GetGenres Get a list of all genres, including names and slugs.

API docs: https://trakt.docs.apiary.io/#reference/genres/list/get-genres

type InvalidUserError added in v1.9.0

type InvalidUserError struct {
	Response *http.Response
	Message  string `json:"message"`
}

InvalidUserError occurs when trakt.tv returns 401 error

func (*InvalidUserError) Error added in v1.9.0

func (r *InvalidUserError) Error() string

type LanguagesService added in v1.7.0

type LanguagesService Service

LanguagesService handles communication with the languages related methods of the Trakt API.

func (*LanguagesService) GetLanguages added in v1.7.0

func (g *LanguagesService) GetLanguages(ctx context.Context, strType *string) ([]*str.Language, *str.Response, error)

GetLanguages Get a list of all languages, including names and codes.

API docs: https://trakt.docs.apiary.io/#reference/languages/list/get-languages

type ListsService added in v1.4.0

type ListsService Service

ListsService handles communication with the lists related methods of the Trakt API.

func (*ListsService) GetAllUsersWhoLikedList added in v1.4.0

func (l *ListsService) GetAllUsersWhoLikedList(ctx context.Context, opts *uri.ListOptions, id *string) ([]*str.UserLike, *str.Response, error)

GetAllUsersWhoLikedList Returns all users who liked a list.

API docs: https://trakt.docs.apiary.io/#reference/lists/list-likes/get-all-users-who-liked-a-list

func (*ListsService) GetList added in v1.4.0

func (l *ListsService) GetList(ctx context.Context, id *string) (*str.PersonalList, *str.Response, error)

GetList Returns a single list. Use the /lists/:id/items method to get the actual items this list contains.

API docs: https://trakt.docs.apiary.io/#reference/lists/list/get-list

func (*ListsService) GetListComments added in v1.4.0

func (l *ListsService) GetListComments(ctx context.Context, id *string, sort *string, opts *uri.ListOptions) ([]*str.ListComment, *str.Response, error)

GetListComments Returns comments from single list.

API docs: https://trakt.docs.apiary.io/#reference/lists/list-comments/get-all-list-comments

func (*ListsService) GetListItems added in v1.4.0

func (l *ListsService) GetListItems(ctx context.Context, id *string, t *string, opts *uri.ListOptions) ([]*str.UserListItem, *str.Response, error)

GetListItems Returns items from single list.

API docs: https://trakt.docs.apiary.io/#reference/lists/list-items/get-items-on-a-list

func (*ListsService) GetPopularLists added in v1.4.0

func (l *ListsService) GetPopularLists(ctx context.Context, opts *uri.ListOptions) ([]*str.List, *str.Response, error)

GetPopularLists Returns the most popular lists. Popularity is calculated using total number of likes and comments..

API docs: https://trakt.docs.apiary.io/#reference/lists/popular/get-popular-lists

func (*ListsService) GetTrendingLists added in v1.4.0

func (l *ListsService) GetTrendingLists(ctx context.Context, opts *uri.ListOptions) ([]*str.List, *str.Response, error)

GetTrendingLists Returns all lists with the most likes and comments over the last 7 days.

API docs: https://trakt.docs.apiary.io/#reference/lists/trending/get-trending-lists

func (*ListsService) LikeList added in v1.4.0

func (l *ListsService) LikeList(ctx context.Context, id *string) (*str.Response, error)

LikeList Votes help determine popular lists. Only one like is allowed per list per user.

API docs: https://trakt.docs.apiary.io/#reference/lists/list-like/like-a-list

func (*ListsService) RemoveLikeList added in v1.4.0

func (l *ListsService) RemoveLikeList(ctx context.Context, id *string) (*str.Response, error)

RemoveLikeList Remove a like on a list.

API docs: https://trakt.docs.apiary.io/#reference/lists/list-like/remove-like-on-a-list

type MoviesService added in v1.5.0

type MoviesService Service

MoviesService handles communication with the movies related methods of the Trakt API.

func (*MoviesService) GetAllMovieAliases added in v1.8.0

func (m *MoviesService) GetAllMovieAliases(ctx context.Context, id *string) ([]*str.Alias, *str.Response, error)

GetAllMovieAliases Returns all title aliases for a movie. Includes country where name is different.

API docs: https://trakt.docs.apiary.io/#reference/movies/aliases/get-all-movie-aliases

func (*MoviesService) GetAllMovieComments added in v1.8.0

func (m *MoviesService) GetAllMovieComments(ctx context.Context, id *string, sort *string, opts *uri.ListOptions) ([]*str.Comment, *str.Response, error)

GetAllMovieComments Returns all top level comments for a movie. By default, the newest comments are returned first. Other sorting options include oldest, most likes, most replies, highest rated, lowest rated, and most plays..

API docs: https://trakt.docs.apiary.io/#reference/movies/comments/get-all-movie-comments

func (*MoviesService) GetAllMovieReleases added in v1.8.0

func (m *MoviesService) GetAllMovieReleases(ctx context.Context, id *string, country *string) ([]*str.Release, *str.Response, error)

GetAllMovieReleases Returns all releases for a movie including country, certification, release date, release type, and note.

API docs: https://trakt.docs.apiary.io/#reference/movies/releases/get-all-movie-releases

func (*MoviesService) GetAllMovieTranslations added in v1.8.0

func (m *MoviesService) GetAllMovieTranslations(ctx context.Context, id *string, language *string) ([]*str.Translation, *str.Response, error)

GetAllMovieTranslations Returns all translations for a movie, including language and translated values for title, tagline and overview.

API docs: https://trakt.docs.apiary.io/#reference/movies/translations/get-all-movie-translations

func (*MoviesService) GetAllPeopleForMovie added in v1.8.0

func (m *MoviesService) GetAllPeopleForMovie(ctx context.Context, id *string, opts *uri.ListOptions) (*str.MoviePeople, *str.Response, error)

GetAllPeopleForMovie Returns all cast and crew for a movie. Each cast member will have a characters array and a standard person object.

API docs: https://trakt.docs.apiary.io/#reference/movies/people/get-all-people-for-a-movie

func (*MoviesService) GetAnticipatedMovies added in v1.8.0

func (m *MoviesService) GetAnticipatedMovies(ctx context.Context, opts *uri.ListOptions) ([]*str.MoviesItem, *str.Response, error)

GetAnticipatedMovies Returns the most anticipated movies based on the number of lists a movie appears on. API docs: https://trakt.docs.apiary.io/#reference/movies/anticipated/get-the-most-anticipated-movies

func (*MoviesService) GetBoxoffice added in v1.8.0

func (m *MoviesService) GetBoxoffice(ctx context.Context, opts *uri.ListOptions) ([]*str.MoviesItem, *str.Response, error)

GetBoxoffice Returns the top 10 grossing movies in the U.S. box office last weekend. Updated every Monday morning. API docs: https://trakt.docs.apiary.io/#reference/movies/box-office/get-the-weekend-box-office

func (*MoviesService) GetCollectedMovies added in v1.8.0

func (m *MoviesService) GetCollectedMovies(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.MoviesItem, *str.Response, error)

GetCollectedMovies Returns the most collected (unique users) movies in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/movies/collected/get-the-most-collected-movies

func (*MoviesService) GetFavoritedMovies added in v1.8.0

func (m *MoviesService) GetFavoritedMovies(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.MoviesItem, *str.Response, error)

GetFavoritedMovies Returns the most favorited movies in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/movies/favorited/get-favorited-movies

func (*MoviesService) GetListsContainingMovie added in v1.8.0

func (m *MoviesService) GetListsContainingMovie(ctx context.Context, id *string, t *string, sort *string, opts *uri.ListOptions) ([]*str.PersonalList, *str.Response, error)

GetListsContainingMovie Returns all lists that contain this movie. By default, personal lists are returned sorted by the most popular.

API docs: https://trakt.docs.apiary.io/#reference/movies/lists/get-lists-containing-this-movie

func (*MoviesService) GetMovie added in v1.5.0

func (m *MoviesService) GetMovie(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Movie, *str.Response, error)

GetMovie Returns movie object.

func (*MoviesService) GetMovieRatings added in v1.8.0

func (m *MoviesService) GetMovieRatings(ctx context.Context, id *string) (*str.MovieRatings, *str.Response, error)

GetMovieRatings Returns rating (between 0 and 10) and distribution for a movie.

API docs: https://trakt.docs.apiary.io/#reference/movies/ratings/get-movie-ratings

func (*MoviesService) GetMovieStats added in v1.8.0

func (m *MoviesService) GetMovieStats(ctx context.Context, id *string) (*str.MovieStats, *str.Response, error)

GetMovieStats Returns lots of movie stats.

API docs: https://trakt.docs.apiary.io/#reference/movies/stats/get-movie-stats

func (*MoviesService) GetMovieStudios added in v1.8.0

func (m *MoviesService) GetMovieStudios(ctx context.Context, id *string) ([]*str.Studio, *str.Response, error)

GetMovieStudios Returns all studios for movie.

API docs: https://trakt.docs.apiary.io/#reference/movies/studios/get-movie-studios

func (*MoviesService) GetMovieVideos added in v1.8.0

func (m *MoviesService) GetMovieVideos(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.Video, *str.Response, error)

GetMovieVideos Returns all videos including trailers, teasers, clips, and featurettes.

API docs: https://trakt.docs.apiary.io/#reference/movies/videos/get-all-videos

func (*MoviesService) GetMovieWatching added in v1.8.0

func (m *MoviesService) GetMovieWatching(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.UserProfile, *str.Response, error)

GetMovieWatching Returns all users watching this movie right now.

API docs: https://trakt.docs.apiary.io/#reference/movies/studios/get-users-watching-right-now

func (*MoviesService) GetPlayedMovies added in v1.8.0

func (m *MoviesService) GetPlayedMovies(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.MoviesItem, *str.Response, error)

GetPlayedMovies Returns the most played (a single user can watch multiple times) movies in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/movies/played/get-the-most-played-movies

func (*MoviesService) GetPopularMovies added in v1.8.0

func (m *MoviesService) GetPopularMovies(ctx context.Context, opts *uri.ListOptions) ([]*str.Movie, *str.Response, error)

GetPopularMovies Returns the most popular movies. Popularity is calculated using the rating percentage and the number of ratings. API docs: https://trakt.docs.apiary.io/#reference/movies/popular/get-popular-movies

func (*MoviesService) GetRecentlyUpdatedMovies added in v1.8.0

func (m *MoviesService) GetRecentlyUpdatedMovies(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*str.MoviesItem, *str.Response, error)

GetRecentlyUpdatedMovies Returns all movies updated since the specified UTC date and time.

API docs: https://trakt.docs.apiary.io/#reference/movies/updates/get-recently-updated-movies

func (*MoviesService) GetRecentlyUpdatedMoviesTraktIDs added in v1.8.0

func (m *MoviesService) GetRecentlyUpdatedMoviesTraktIDs(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*int, *str.Response, error)

GetRecentlyUpdatedMoviesTraktIDs Returns all movie Trakt IDs updated since the specified UTC date and time.

API docs: https://trakt.docs.apiary.io/#reference/movies/updated-ids/get-recently-updated-movie-trakt-ids

func (*MoviesService) GetRelatedMovies added in v1.8.0

func (m *MoviesService) GetRelatedMovies(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.Movie, *str.Response, error)

GetRelatedMovies Returns related and similar movies.

API docs: https://trakt.docs.apiary.io/#reference/movies/related/get-related-movies

func (*MoviesService) GetTrendingMovies added in v1.8.0

func (m *MoviesService) GetTrendingMovies(ctx context.Context, opts *uri.ListOptions) ([]*str.MoviesItem, *str.Response, error)

GetTrendingMovies Returns the most watched movies over the last 24 hours. Movies with the most watchers are returned first. API docs: https://trakt.docs.apiary.io/#reference/movies/trending/get-trending-movies

func (*MoviesService) GetWatchedMovies added in v1.8.0

func (m *MoviesService) GetWatchedMovies(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.MoviesItem, *str.Response, error)

GetWatchedMovies Returns the most watched (unique users) movies in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/movies/watched/get-the-most-watched-movies

func (*MoviesService) RefreshMovieMetadata added in v1.8.0

func (m *MoviesService) RefreshMovieMetadata(ctx context.Context, id *string) (*str.Response, error)

RefreshMovieMetadata Queue this movie for a full metadata and image refresh. It might take up to 8 hours for the updated metadata to be availabe through the API.

API docs: https://trakt.docs.apiary.io/#reference/movies/refresh/refresh-movie-metadata

type NetworksService added in v1.9.0

type NetworksService Service

NetworksService handles communication with the movies related methods of the Trakt API.

func (*NetworksService) GetNetworksList added in v1.9.0

func (m *NetworksService) GetNetworksList(ctx context.Context, opts *uri.ListOptions) ([]*str.TvNetwork, *str.Response, error)

GetNetworksList Get a list of all TV networks, including the name, country, and ids.

type NotFoundError added in v1.4.0

type NotFoundError struct {
	Response *http.Response
	Message  string `json:"message"`
}

NotFoundError occurs when trakt.tv returns 404 error

func (*NotFoundError) Error added in v1.4.0

func (r *NotFoundError) Error() string

type NotesService added in v1.9.0

type NotesService Service

NotesService handles communication with the notes related methods of the Trakt API.

func (*NotesService) AddNotes added in v1.9.0

func (n *NotesService) AddNotes(ctx context.Context, notes *str.Notes) (*str.Notes, *str.Response, error)

AddNotes Add a new notes to a movie, show, season, episode, or person.

API docs:https://trakt.docs.apiary.io/#reference/notes/notes/add-notes

func (*NotesService) DeleteNotes added in v1.9.0

func (n *NotesService) DeleteNotes(ctx context.Context, id *string) (*str.Response, error)

DeleteNotes Delete a single note.

API docs: https://trakt.docs.apiary.io/#reference/notes/note/delete-a-note

func (*NotesService) GetNotes added in v1.9.0

func (n *NotesService) GetNotes(ctx context.Context, id *string) (*str.Notes, *str.Response, error)

GetNotes Return a single note.

API docs:https://trakt.docs.apiary.io/#reference/notes/note/get-a-note

func (*NotesService) GetNotesItem added in v1.9.0

func (n *NotesService) GetNotesItem(ctx context.Context, id *string) (*str.NotesItem, *str.Response, error)

GetNotesItem Returns the item this note is attached_to.

API docs:https://trakt.docs.apiary.io/#reference/notes/item/get-the-attached-item

func (*NotesService) UpdateNotes added in v1.9.0

func (n *NotesService) UpdateNotes(ctx context.Context, id *string, notes *str.Notes) (*str.Notes, *str.Response, error)

UpdateNotes Update a single note (500 maximum characters).

API docs:https://trakt.docs.apiary.io/#reference/notes/note/update-a-note

type OauthService

type OauthService Service

OauthService handles communication with the oauth related methods of the Trakt API.

API docs: https://trakt.docs.apiary.io/#reference/authentication-oauth

func (*OauthService) ExchangeRefreshTokenForAccessToken

func (o *OauthService) ExchangeRefreshTokenForAccessToken(ctx context.Context, deviceToken *str.CurrentDeviceToken) (*str.DeviceToken, *str.Response, error)

ExchangeRefreshTokenForAccessToken Use the refresh_token to get a new access_token without asking the user to re-authenticate. The access_token is valid for 3 months before it needs to be refreshed again.

API docs: https://trakt.docs.apiary.io/#reference/authentication-oauth/get-token/exchange-refresh_token-for-access_token

func (*OauthService) GenerateNewDeviceCodes

func (o *OauthService) GenerateNewDeviceCodes(ctx context.Context, code *str.NewDeviceCode) (*str.DeviceCode, *str.Response, error)

GenerateNewDeviceCodes Generate new codes to start the device authentication process.

API docs: https://trakt.docs.apiary.io/#reference/authentication-devices/device-code/generate-new-device-codes

func (*OauthService) PoolForTheAccessToken

func (o *OauthService) PoolForTheAccessToken(ctx context.Context, deviceToken *str.NewDeviceToken) (*str.DeviceToken, *str.Response, error)

PoolForTheAccessToken Use the device_code and poll at the interval (in seconds) to check if the user has authorized you app.

API docs: https://trakt.docs.apiary.io/#reference/authentication-devices/get-token/poll-for-the-access_token

type PeopleService

type PeopleService Service

PeopleService handles communication with the people related methods of the Trakt API.

func (*PeopleService) GetAllPeopleForShow added in v1.10.0

func (p *PeopleService) GetAllPeopleForShow(ctx context.Context, id *string, opts *uri.ListOptions) (*str.ShowPeople, *str.Response, error)

GetAllPeopleForShow Returns all cast and crew for a show. Each cast member will have a characters array and a standard person object.

API docs: https://trakt.docs.apiary.io/#reference/shows/people/get-all-people-for-a-show

func (*PeopleService) GetListsContainingThisPerson

func (p *PeopleService) GetListsContainingThisPerson(ctx context.Context, id *string, typeString *string, sort *string, opts *uri.ListOptions) ([]*str.PersonalList, *str.Response, error)

GetListsContainingThisPerson Returns all lists that contain this person.

API docs: https://trakt.docs.apiary.io/#reference/people/lists/get-lists-containing-this-person

func (*PeopleService) GetMovieCredits

func (p *PeopleService) GetMovieCredits(ctx context.Context, id *string, opts *uri.ListOptions) (*str.PersonMovies, *str.Response, error)

GetMovieCredits Returns all movies where this person is in the cast or crew.

API docs: https://trakt.docs.apiary.io/#reference/people/movies/get-movie-credits

func (*PeopleService) GetRecentlyUpdatedPeople

func (p *PeopleService) GetRecentlyUpdatedPeople(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*str.PersonItem, *str.Response, error)

GetRecentlyUpdatedPeople Returns all people updated since the specified UTC date and time.

API docs: https://trakt.docs.apiary.io/#reference/people/updates/get-recently-updated-people

func (*PeopleService) GetRecentlyUpdatedPeopleTraktIDs

func (p *PeopleService) GetRecentlyUpdatedPeopleTraktIDs(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*int, *str.Response, error)

GetRecentlyUpdatedPeopleTraktIDs Returns all people Trakt IDs updated since the specified UTC date and time.

API docs: https://trakt.docs.apiary.io/#reference/people/updated-ids

func (*PeopleService) GetShowCredits

func (p *PeopleService) GetShowCredits(ctx context.Context, id *string, opts *uri.ListOptions) (*str.PersonShows, *str.Response, error)

GetShowCredits Returns all shows where this person is in the cast or crew, including the episode_count for which they appear.

API docs: https://trakt.docs.apiary.io/#reference/people/shows/get-show-credits

func (*PeopleService) GetSinglePerson

func (p *PeopleService) GetSinglePerson(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Person, *str.Response, error)

GetSinglePerson Returns a single person's details.

API docs: https://trakt.docs.apiary.io/#reference/people/summary/get-a-single-person

func (*PeopleService) RefreshPersonMetadata added in v1.5.0

func (p *PeopleService) RefreshPersonMetadata(ctx context.Context, id *string) (*str.Response, error)

RefreshPersonMetadata Queue this person for a full metadata and image refresh. It might take up to 8 hours for the updated metadata to be availabe through the API.

API docs: https://trakt.docs.apiary.io/#reference/people/refresh/refresh-person-metadata

type PreconditionFailedRequestError added in v1.13.0

type PreconditionFailedRequestError struct {
	Response *http.Response
	Message  string `json:"message"`
}

PreconditionFailedRequestError occurs when trakt.tv returns 412 error

func (*PreconditionFailedRequestError) Error added in v1.13.0

type RecommendationsService added in v1.9.0

type RecommendationsService Service

RecommendationsService handles communication with the recommendations related methods of the Trakt API.

func (*RecommendationsService) GetMovieRecommendations added in v1.9.0

func (m *RecommendationsService) GetMovieRecommendations(ctx context.Context, opts *uri.ListOptions) ([]*str.Recommendation, *str.Response, error)

GetMovieRecommendations Movie recommendations for a user. API docs:https://trakt.docs.apiary.io/#reference/recommendations/movies/get-movie-recommendations

func (*RecommendationsService) GetShowRecommendations added in v1.9.0

func (m *RecommendationsService) GetShowRecommendations(ctx context.Context, opts *uri.ListOptions) ([]*str.Recommendation, *str.Response, error)

GetShowRecommendations Show recommendations for a user. API docs:https://trakt.docs.apiary.io/#reference/recommendations/shows/get-show-recommendations

func (*RecommendationsService) HideMovieRecommendation added in v1.9.0

func (m *RecommendationsService) HideMovieRecommendation(ctx context.Context, id *string) (*str.Response, error)

HideMovieRecommendation to hide a movie from getting recommended anymore.. API docs:https://trakt.docs.apiary.io/#reference/recommendations/hide-movie/hide-a-movie-recommendation

func (*RecommendationsService) HideShowRecommendation added in v1.9.0

func (m *RecommendationsService) HideShowRecommendation(ctx context.Context, id *string) (*str.Response, error)

HideShowRecommendation to hide a show from getting recommended anymore. API docs:https://trakt.docs.apiary.io/#reference/recommendations/hide-show/hide-a-show-recommendation

type RequestOption

type RequestOption func(req *http.Request)

RequestOption represents an option that can modify an http.Request.

type ScrobbleService added in v1.9.0

type ScrobbleService Service

ScrobbleService handles communication with the scrobble related methods of the Trakt API.

func (*ScrobbleService) PauseScrobble added in v1.9.0

func (s *ScrobbleService) PauseScrobble(ctx context.Context, scrobble *str.Scrobble) (*str.Scrobble, *str.Response, error)

PauseScrobble Pause watching in a media server. API docs: https://trakt.docs.apiary.io/#reference/scrobble/pause/pause-watching-in-a-media-center

func (*ScrobbleService) StartScrobble added in v1.9.0

func (s *ScrobbleService) StartScrobble(ctx context.Context, scrobble *str.Scrobble) (*str.Scrobble, *str.Response, error)

StartScrobble Start watching in a media server. API docs:https://trakt.docs.apiary.io/#reference/scrobble/start/start-watching-in-a-media-center

func (*ScrobbleService) StopScrobble added in v1.9.0

func (s *ScrobbleService) StopScrobble(ctx context.Context, scrobble *str.Scrobble) (*str.Scrobble, *str.Response, error)

StopScrobble Stop watching in a media server. API docs: https://trakt.docs.apiary.io/#reference/scrobble/stop/stop-or-finish-watching-in-a-media-center

type SearchService

type SearchService Service

SearchService handles communication with the search related methods of the Trakt API.

func (*SearchService) GetIDLookupResults

func (s *SearchService) GetIDLookupResults(ctx context.Context, formatType *string, id *string, opts *uri.ListOptions) ([]*str.SearchListItem, *str.Response, error)

GetIDLookupResults Lookup items by their Trakt, IMDB, TMDB, or TVDB ID. If you use the search url without a type it might return multiple items if the id_type is not globally unique. Specify the type of results by sending a single value or a comma delimited string for multiple types.

API docs: https://trakt.docs.apiary.io/#reference/search/id-lookup/get-id-lookup-results

func (*SearchService) GetTextQueryResults

func (s *SearchService) GetTextQueryResults(ctx context.Context, searchType *string, opts *uri.ListOptions) ([]*str.SearchListItem, *str.Response, error)

GetTextQueryResults Search all text fields that a media object contains (i.e. title, overview, etc). Results are ordered by the most relevant score. Specify the type of results by sending a single value or a comma delimited string for multiple types.

API docs: https://trakt.docs.apiary.io/#reference/search/text-query/get-text-query-results

type SeasonsService added in v1.6.0

type SeasonsService Service

SeasonsService handles communication with the seasons related methods of the Trakt API.

func (*SeasonsService) GetSeason added in v1.6.0

func (s *SeasonsService) GetSeason(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Season, *str.Response, error)

GetSeason Returns season object.

type ServerError added in v1.9.0

type ServerError struct {
	Response *http.Response
	Message  string `json:"message"`
}

ServerError occurs when trakt.tv returns 500 error

func (*ServerError) Error added in v1.9.0

func (r *ServerError) Error() string

type Service

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

Service structure for other services

type SetupData added in v1.9.0

type SetupData struct {
	Client    *Client
	Mux       *http.ServeMux
	ServerURL string
	Teardown  func()
}

SetupData comment

func Setup added in v1.9.0

func Setup() *SetupData

Setup sets up a test HTTP server along with a trakt.Client that is configured to talk to that test server. Tests should register handlers on mux which provide mock responses for the API method being tested.

type ShowsService added in v1.5.0

type ShowsService Service

ShowsService handles communication with the shows related methods of the Trakt API.

func (*ShowsService) GetAllEpisodeComments added in v1.13.0

func (s *ShowsService) GetAllEpisodeComments(ctx context.Context, id *string, season *int, episode *int, sort *string, opts *uri.ListOptions) ([]*str.Comment, *str.Response, error)

GetAllEpisodeComments Returns all top level comments for an episode. By default, the newest comments are returned first. Other sorting options include oldest, most likes, most replies, highest rated, lowest rated, and most plays.. API docs: https://trakt.docs.apiary.io/#reference/episodes/comments/get-all-episode-comments

func (*ShowsService) GetAllEpisodeTranslations added in v1.13.0

func (s *ShowsService) GetAllEpisodeTranslations(ctx context.Context, id *string, season *int, episode *int, language *string) ([]*str.Translation, *str.Response, error)

GetAllEpisodeTranslations Returns all translations for an episode, including language and translated values for title, tagline and overview. API docs: https://trakt.docs.apiary.io/#reference/episodes/translations/get-all-episode-translations

func (*ShowsService) GetAllEpisodesForSingleSeason added in v1.12.0

func (s *ShowsService) GetAllEpisodesForSingleSeason(ctx context.Context, id *string, season *int, opts *uri.ListOptions) ([]*str.Episode, *str.Response, error)

GetAllEpisodesForSingleSeason Returns a single seasons for a show. API docs: https://trakt.docs.apiary.io/#reference/seasons/episodes/get-all-episodes-for-a-single-season

func (*ShowsService) GetAllPeopleForEpisode added in v1.13.0

func (s *ShowsService) GetAllPeopleForEpisode(ctx context.Context, id *string, season *int, episode *int, opts *uri.ListOptions) (*str.EpisodePeople, *str.Response, error)

GetAllPeopleForEpisode Returns all cast and crew for an episode. Each cast member will have a characters array and a standard person object.

API docs: https://trakt.docs.apiary.io/#reference/episodes/people/get-all-people-for-an-episode

func (*ShowsService) GetAllPeopleForSeason added in v1.12.0

func (s *ShowsService) GetAllPeopleForSeason(ctx context.Context, id *string, season *int, opts *uri.ListOptions) (*str.SeasonPeople, *str.Response, error)

GetAllPeopleForSeason Returns all cast and crew for a season. Each cast member will have a characters array and a standard person object.

API docs: https://trakt.docs.apiary.io/#reference/seasons/people/get-all-people-for-a-season

func (*ShowsService) GetAllSeasonComments added in v1.12.0

func (s *ShowsService) GetAllSeasonComments(ctx context.Context, id *string, season *int, sort *string, opts *uri.ListOptions) ([]*str.Comment, *str.Response, error)

GetAllSeasonComments Returns all top level comments for a season. By default, the newest comments are returned first. Other sorting options include oldest, most likes, most replies, highest rated, lowest rated, and most plays..

API docs: https://trakt.docs.apiary.io/#reference/seasons/comments/get-all-season-comments

func (*ShowsService) GetAllSeasonTranslations added in v1.12.0

func (s *ShowsService) GetAllSeasonTranslations(ctx context.Context, id *string, season *int, language *string, opts *uri.ListOptions) ([]*str.Translation, *str.Response, error)

GetAllSeasonTranslations Returns all translations for an season, including language and translated values for title and overview. API docs: https://trakt.docs.apiary.io/#reference/seasons/episodes/get-all-season-translations

func (*ShowsService) GetAllSeasonsForShow added in v1.12.0

func (s *ShowsService) GetAllSeasonsForShow(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.Season, *str.Response, error)

GetAllSeasonsForShow Returns all seasons for a show including the number of episodes in each season. API docs: https://trakt.docs.apiary.io/#reference/seasons/summary/get-all-seasons-for-a-show

func (*ShowsService) GetAllShowAliases added in v1.10.0

func (s *ShowsService) GetAllShowAliases(ctx context.Context, id *string) ([]*str.Alias, *str.Response, error)

GetAllShowAliases Returns all title aliases for a show. Includes country where name is different. API docs: https://trakt.docs.apiary.io/#reference/shows/aliases/get-all-show-aliases

func (*ShowsService) GetAllShowCertifications added in v1.10.0

func (s *ShowsService) GetAllShowCertifications(ctx context.Context, id *string) ([]*str.Certification, *str.Response, error)

GetAllShowCertifications Returns all content certifications for a show, including the country. API docs: https://trakt.docs.apiary.io/#reference/shows/certifications/get-all-show-certifications

func (*ShowsService) GetAllShowComments added in v1.10.0

func (s *ShowsService) GetAllShowComments(ctx context.Context, id *string, sort *string, opts *uri.ListOptions) ([]*str.Comment, *str.Response, error)

GetAllShowComments Returns all top level comments for a show. By default, the newest comments are returned first. Other sorting options include oldest, most likes, most replies, highest rated, lowest rated, and most plays.. API docs: https://trakt.docs.apiary.io/#reference/shows/comments/get-all-show-comments

func (*ShowsService) GetAllShowTranslations added in v1.10.0

func (s *ShowsService) GetAllShowTranslations(ctx context.Context, id *string, language *string) ([]*str.Translation, *str.Response, error)

GetAllShowTranslations Returns all translations for a show, including language and translated values for title, tagline and overview. API docs: https://trakt.docs.apiary.io/#reference/shows/translations/get-all-show-translations

func (*ShowsService) GetAnticipatedShows added in v1.10.0

func (s *ShowsService) GetAnticipatedShows(ctx context.Context, opts *uri.ListOptions) ([]*str.ShowsItem, *str.Response, error)

GetAnticipatedShows Returns the most anticipated shows based on the number of lists a show appears on. API docs: https://trakt.docs.apiary.io/#reference/shows/anticipated/get-the-most-anticipated-shows

func (*ShowsService) GetCollectedShows added in v1.10.0

func (s *ShowsService) GetCollectedShows(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.ShowsItem, *str.Response, error)

GetCollectedShows Returns the most collected (unique users) shows in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/shows/collected/get-the-most-collected-shows

func (*ShowsService) GetEpisodeRatings added in v1.13.0

func (s *ShowsService) GetEpisodeRatings(ctx context.Context, id *string, season *int, episode *int) (*str.EpisodeRatings, *str.Response, error)

GetEpisodeRatings Returns rating (between 0 and 10) and distribution for an episode.

API docs: https://trakt.docs.apiary.io/#reference/episodes/ratings/get-episode-ratings

func (*ShowsService) GetEpisodeStats added in v1.13.0

func (s *ShowsService) GetEpisodeStats(ctx context.Context, id *string, season *int, episode *int) (*str.EpisodeStats, *str.Response, error)

GetEpisodeStats Returns lots of episode stats.

API docs: https://trakt.docs.apiary.io/#reference/episodes/stats/get-episode-stats

func (*ShowsService) GetEpisodeVideos added in v1.13.0

func (s *ShowsService) GetEpisodeVideos(ctx context.Context, id *string, season *int, episode *int, opts *uri.ListOptions) ([]*str.Video, *str.Response, error)

GetEpisodeVideos Returns all videos including trailers, teasers, clips, and featurettes.

API docs: https://trakt.docs.apiary.io/#reference/episodes/videos/get-all-videos

func (*ShowsService) GetEpisodesWatching added in v1.13.0

func (s *ShowsService) GetEpisodesWatching(ctx context.Context, id *string, season *int, episode *int, opts *uri.ListOptions) ([]*str.UserProfile, *str.Response, error)

GetEpisodesWatching Returns all users watching this episode right now.

API docs: https://trakt.docs.apiary.io/#reference/episodes/watching/get-users-watching-right-now

func (*ShowsService) GetFavoritedShows added in v1.10.0

func (s *ShowsService) GetFavoritedShows(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.ShowsItem, *str.Response, error)

GetFavoritedShows Returns the most favorited shows in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/shows/favorited/get-favorited-shows

func (*ShowsService) GetLastEpisode added in v1.10.0

func (s *ShowsService) GetLastEpisode(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Episode, *str.Response, error)

GetLastEpisode Returns the most recently aired episode. API docs: https://trakt.docs.apiary.io/#reference/shows/last-episode/get-last-episode

func (*ShowsService) GetListsContainingEpisode added in v1.13.0

func (s *ShowsService) GetListsContainingEpisode(ctx context.Context, id *string, season *int, episode *int, t *string, sort *string, opts *uri.ListOptions) ([]*str.PersonalList, *str.Response, error)

GetListsContainingEpisode Returns all lists that contain this episode. By default, personal lists are returned sorted by the most popular.

API docs: https://trakt.docs.apiary.io/#reference/episodes/lists/get-lists-containing-this-episode

func (*ShowsService) GetListsContainingSeason added in v1.12.0

func (s *ShowsService) GetListsContainingSeason(ctx context.Context, id *string, season *int, t *string, sort *string, opts *uri.ListOptions) ([]*str.PersonalList, *str.Response, error)

GetListsContainingSeason Returns all lists that contain this season. By default, personal lists are returned sorted by the most popular.

API docs: https://trakt.docs.apiary.io/#reference/seasons/lists/get-lists-containing-this-season

func (*ShowsService) GetListsContainingShow added in v1.10.0

func (s *ShowsService) GetListsContainingShow(ctx context.Context, id *string, t *string, sort *string, opts *uri.ListOptions) ([]*str.PersonalList, *str.Response, error)

GetListsContainingShow Returns all lists that contain this show. By default, personal lists are returned sorted by the most popular. API docs: https://trakt.docs.apiary.io/#reference/shows/lists/get-lists-containing-this-show

func (*ShowsService) GetNextEpisode added in v1.10.0

func (s *ShowsService) GetNextEpisode(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Episode, *str.Response, error)

GetNextEpisode Returns the next scheduled to air episode. API docs: https://trakt.docs.apiary.io/#reference/shows/next-episode/get-next-episode

func (*ShowsService) GetPlayedShows added in v1.10.0

func (s *ShowsService) GetPlayedShows(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.ShowsItem, *str.Response, error)

GetPlayedShows Returns the most played (a single user can watch multiple episode multiple times) shows in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/shows/played/get-the-most-played-shows

func (*ShowsService) GetPopularShows added in v1.10.0

func (s *ShowsService) GetPopularShows(ctx context.Context, opts *uri.ListOptions) ([]*str.Show, *str.Response, error)

GetPopularShows Returns the most popular shows. Popularity is calculated using the rating percentage and the number of ratings. API docs: https://trakt.docs.apiary.io/#reference/shows/popular/get-popular-shows

func (*ShowsService) GetRecentlyUpdatedShows added in v1.10.0

func (s *ShowsService) GetRecentlyUpdatedShows(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*str.ShowsItem, *str.Response, error)

GetRecentlyUpdatedShows Returns all shows updated since the specified UTC date and time. API docs: https://trakt.docs.apiary.io/#reference/shows/updates/get-recently-updated-shows

func (*ShowsService) GetRecentlyUpdatedShowsTraktIDs added in v1.10.0

func (s *ShowsService) GetRecentlyUpdatedShowsTraktIDs(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*int, *str.Response, error)

GetRecentlyUpdatedShowsTraktIDs Returns all show Trakt IDs updated since the specified UTC date and time. API docs: https://trakt.docs.apiary.io/#reference/shows/updated-ids/get-recently-updated-show-trakt-ids

func (*ShowsService) GetRelatedShows added in v1.10.0

func (s *ShowsService) GetRelatedShows(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.Show, *str.Response, error)

GetRelatedShows Returns related and similar shows. API docs: https://trakt.docs.apiary.io/#reference/shows/related/get-related-shows

func (*ShowsService) GetSeasonRatings added in v1.12.0

func (s *ShowsService) GetSeasonRatings(ctx context.Context, id *string, season *int) (*str.SeasonRatings, *str.Response, error)

GetSeasonRatings Returns rating (between 0 and 10) and distribution for a season.

API docs: https://trakt.docs.apiary.io/#reference/seasons/ratings/get-season-ratings

func (*ShowsService) GetSeasonStats added in v1.12.0

func (s *ShowsService) GetSeasonStats(ctx context.Context, id *string, season *int) (*str.SeasonStats, *str.Response, error)

GetSeasonStats Returns lots of season stats.

API docs: https://trakt.docs.apiary.io/#reference/seasons/stats/get-season-stats

func (*ShowsService) GetSeasonsVideos added in v1.12.0

func (s *ShowsService) GetSeasonsVideos(ctx context.Context, id *string, season *int, opts *uri.ListOptions) ([]*str.Video, *str.Response, error)

GetSeasonsVideos Returns all videos including trailers, teasers, clips, and featurettes.

API docs: https://trakt.docs.apiary.io/#reference/seasons/videos/get-all-videos

func (*ShowsService) GetSeasonsWatching added in v1.12.0

func (s *ShowsService) GetSeasonsWatching(ctx context.Context, id *string, season *int, opts *uri.ListOptions) ([]*str.UserProfile, *str.Response, error)

GetSeasonsWatching Returns all users watching this season right now.

API docs: https://trakt.docs.apiary.io/#reference/seasons/watching/get-users-watching-right-now

func (*ShowsService) GetShow added in v1.5.0

func (s *ShowsService) GetShow(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Show, *str.Response, error)

GetShow Returns episode object.

func (*ShowsService) GetShowCollectionProgress added in v1.10.0

func (s *ShowsService) GetShowCollectionProgress(ctx context.Context, id *string, opts *uri.ListOptions) (*str.CollectionProgress, error)

GetShowCollectionProgress Returns collection progress for a show including details on all aired seasons and episodes. API docs: https://trakt.docs.apiary.io/#reference/shows/collection-progress/get-show-collection-progress

func (*ShowsService) GetShowRatings added in v1.10.0

func (s *ShowsService) GetShowRatings(ctx context.Context, id *string) (*str.ShowRatings, *str.Response, error)

GetShowRatings Returns rating (between 0 and 10) and distribution for a show. API docs: https://trakt.docs.apiary.io/#reference/shows/ratings/get-show-ratings

func (*ShowsService) GetShowStats added in v1.10.0

func (s *ShowsService) GetShowStats(ctx context.Context, id *string) (*str.ShowStats, *str.Response, error)

GetShowStats Returns lots of show stats. API docs: https://trakt.docs.apiary.io/#reference/shows/stats/get-show-stats

func (*ShowsService) GetShowStudios added in v1.10.0

func (s *ShowsService) GetShowStudios(ctx context.Context, id *string) ([]*str.Studio, *str.Response, error)

GetShowStudios Returns all studios for show. API docs: https://trakt.docs.apiary.io/#reference/shows/studios/get-show-studios

func (*ShowsService) GetShowVideos added in v1.10.0

func (s *ShowsService) GetShowVideos(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.Video, *str.Response, error)

GetShowVideos Returns all videos including trailers, teasers, clips, and featurettes. API docs: https://trakt.docs.apiary.io/#reference/shows/videos/get-all-videos

func (*ShowsService) GetShowWatchedProgress added in v1.10.0

func (s *ShowsService) GetShowWatchedProgress(ctx context.Context, id *string, opts *uri.ListOptions) (*str.WatchedProgress, error)

GetShowWatchedProgress Returns watched progress for a show including details on all aired seasons and episodes. API docs: https://trakt.docs.apiary.io/#reference/shows/watched-progress/get-show-watched-progress

func (*ShowsService) GetShowWatching added in v1.10.0

func (s *ShowsService) GetShowWatching(ctx context.Context, id *string, opts *uri.ListOptions) ([]*str.UserProfile, *str.Response, error)

GetShowWatching Returns all users watching this show right now. API docs: https://trakt.docs.apiary.io/#reference/shows/studios/get-users-watching-right-now

func (*ShowsService) GetSingleEpisodeForShow added in v1.13.0

func (s *ShowsService) GetSingleEpisodeForShow(ctx context.Context, id *string, season *int, episode *int, opts *uri.ListOptions) (*str.Episode, *str.Response, error)

GetSingleEpisodeForShow Returns a single episode's details.

API docs: https://trakt.docs.apiary.io/#reference/episodes/summary/get-a-single-episode-for-a-show

func (*ShowsService) GetSingleSeasonsForShow added in v1.12.0

func (s *ShowsService) GetSingleSeasonsForShow(ctx context.Context, id *string, season *int, opts *uri.ListOptions) (*str.Season, *str.Response, error)

GetSingleSeasonsForShow Returns a single seasons for a show. API docs: https://trakt.docs.apiary.io/#reference/seasons/season/get-single-seasons-for-a-show

func (*ShowsService) GetTrendingShows added in v1.10.0

func (s *ShowsService) GetTrendingShows(ctx context.Context, opts *uri.ListOptions) ([]*str.ShowsItem, *str.Response, error)

GetTrendingShows Returns the most watched shows over the last 24 hours. Shows with the most watchers are returned first. API docs: https://trakt.docs.apiary.io/#reference/shows/trending/get-trending-shows

func (*ShowsService) GetWatchedShows added in v1.10.0

func (s *ShowsService) GetWatchedShows(ctx context.Context, opts *uri.ListOptions, period *string) ([]*str.ShowsItem, *str.Response, error)

GetWatchedShows Returns the most watched (unique users) shows in the specified time period, defaulting to weekly. All stats are relative to the specific time period. API docs: https://trakt.docs.apiary.io/#reference/shows/watched/get-the-most-watched-shows

func (*ShowsService) RefreshShowMetadata added in v1.10.0

func (s *ShowsService) RefreshShowMetadata(ctx context.Context, id *string) (*str.Response, error)

RefreshShowMetadata Queue this show for a full metadata and image refresh. It might take up to 8 hours for the updated metadata to be availabe through the API. API docs: https://trakt.docs.apiary.io/#reference/shows/refresh/refresh-show-metadata

func (*ShowsService) ResetShowProgress added in v1.10.0

func (s *ShowsService) ResetShowProgress(ctx context.Context, id *string, progress *str.WatchedProgress) (*str.WatchedProgress, *str.Response, error)

ResetShowProgress Reset a show's progress when the user started re-watching the show. API docs:https://trakt.docs.apiary.io/#reference/shows/reset-watched-progress/reset-show-progress

func (*ShowsService) UndoResetShowProgress added in v1.10.0

func (s *ShowsService) UndoResetShowProgress(ctx context.Context, id *string) (*str.Response, error)

UndoResetShowProgress Undo the reset and have watched progress use all watched history for the show. API docs:https://trakt.docs.apiary.io/#reference/shows/reset-watched-progress/undo-reset-show-progress

type SyncService

type SyncService Service

SyncService handles communication with the sync related methods of the Trakt API.

func (*SyncService) GetCollection

func (s *SyncService) GetCollection(ctx context.Context, types *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)

GetCollection Get all collected items in a user's collection.

API docs: https://trakt.docs.apiary.io/#reference/sync/get-collection/get-collection

func (*SyncService) GetWatchedHistory

func (s *SyncService) GetWatchedHistory(ctx context.Context, types *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)

GetWatchedHistory Returns movies and episodes that a user has watched, sorted by most recent.

API docs: https://trakt.docs.apiary.io/#reference/sync/get-watched/get-watched-history

func (*SyncService) GetWatchlist

func (s *SyncService) GetWatchlist(ctx context.Context, types *string, sort *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)

GetWatchlist Returns all items in a user's watchlist filtered by type.

API docs: https://trakt.docs.apiary.io/#reference/sync/get-watchlist/get-watchlist

type UpgradeRequiredError added in v1.1.0

type UpgradeRequiredError struct {
	Response   *http.Response
	UpgradeURL *url.URL
	Message    string `json:"message"`
}

UpgradeRequiredError occurs when trakt.tv returns 426 user must upgrade to vip header

func (*UpgradeRequiredError) Error added in v1.1.0

func (r *UpgradeRequiredError) Error() string

type UsersService

type UsersService Service

UsersService handles communication with the users related methods of the Trakt API.

func (*UsersService) GetItemstOnAPersonalList

func (u *UsersService) GetItemstOnAPersonalList(ctx context.Context, id *string, listID *string, t *string) ([]*str.UserListItem, *str.Response, error)

GetItemstOnAPersonalList Get all items on a personal list.

API docs: https://trakt.docs.apiary.io/#reference/users/list-items/get-items-on-a-personal-list

func (*UsersService) GetSavedFilters added in v1.1.0

func (u *UsersService) GetSavedFilters(ctx context.Context, section *string) ([]*str.SavedFilter, *str.Response, error)

GetSavedFilters Get all saved filters a users has created.

API docs: https://trakt.docs.apiary.io/#reference/users/saved-filters/get-saved-filters

func (*UsersService) GetStats added in v1.2.0

func (u *UsersService) GetStats(ctx context.Context, id *string) (*str.UserStats, *str.Response, error)

GetStats Returns stats about the movies, shows, and episodes a user has watched, collected, and rated.

API docs:https://trakt.docs.apiary.io/#reference/users/stats/get-stats

func (*UsersService) GetUserProfile

func (u *UsersService) GetUserProfile(ctx context.Context, id *string) (*str.UserProfile, *str.Response, error)

GetUserProfile Get a user's profile information.

API docs:https://trakt.docs.apiary.io/#reference/users/profile/get-user-profile

func (*UsersService) GetUsersPersonalLists

func (u *UsersService) GetUsersPersonalLists(ctx context.Context, id *string) ([]*str.PersonalList, *str.Response, error)

GetUsersPersonalLists Returns all personal lists for a user.

API docs: https://trakt.docs.apiary.io/#reference/users/lists/get-a-user's-personal-lists

func (*UsersService) GetWatched added in v1.3.0

func (u *UsersService) GetWatched(ctx context.Context, id *string, watchType *string, opts *uri.ListOptions) ([]*str.UserWatched, *str.Response, error)

GetWatched Returns all movies or shows a user has watched sorted by most plays.

API docs:https://trakt.docs.apiary.io/#reference/users/watched/get-watched

func (*UsersService) RetrieveSettings added in v1.5.0

func (u *UsersService) RetrieveSettings(ctx context.Context) (*str.UserSettings, *str.Response, error)

RetrieveSettings Get the user's settings so you can align your app's experience with what they're used to on the trakt website. API docs: https://trakt.docs.apiary.io/#reference/users/settings/retrieve-settings

type ValidationError added in v1.6.0

type ValidationError struct {
	Response *http.Response
	Message  string      `json:"message"`
	Errors   *str.Errors `json:"errors,omitempty"`
}

ValidationError occurs when trakt.tv returns 422 error

func (*ValidationError) Error added in v1.6.0

func (r *ValidationError) Error() string

Jump to

Keyboard shortcuts

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