Documentation
¶
Index ¶
- Constants
- Variables
- func AddToCollection(itemType string, tmdbID string) (resp *napping.Response, err error)
- func AddToUserlist(listID int, itemType string, tmdbID string) (resp *napping.Response, err error)
- func AddToWatchlist(itemType string, tmdbID string) (resp *napping.Response, err error)
- func Authorize(fromSettings bool) error
- func Authorized() error
- func Get(endPoint string, params url.Values) (resp *napping.Response, err error)
- func GetToken(code string) (resp *napping.Response, err error)
- func GetWithAuth(endPoint string, params url.Values) (resp *napping.Response, err error)
- func Post(endPoint string, payload *bytes.Buffer) (resp *napping.Response, err error)
- func PostJSON(endPoint string, obj interface{}) (resp *napping.Response, err error)
- func RefreshToken() (resp *napping.Response, err error)
- func RemoveFromCollection(itemType string, tmdbID string) (resp *napping.Response, err error)
- func RemoveFromUserlist(listID int, itemType string, tmdbID string) (resp *napping.Response, err error)
- func RemoveFromWatchlist(itemType string, tmdbID string) (resp *napping.Response, err error)
- func Request(endPoint string, params napping.Params, isWithAuth bool, isUpdateNeeded bool, ...) error
- func Scrobble(action string, contentType string, tmdbID int, watched float64, ...)
- func SetMultipleWatched(items []*WatchedItem) (resp *napping.Response, err error)
- func SetWatched(item *WatchedItem) (resp *napping.Response, err error)
- func SyncAddedItem(itemType string, tmdbID string, location int) (resp *napping.Response, err error)
- func SyncRemovedItem(itemType string, tmdbID string, location int) (resp *napping.Response, err error)
- func TokenRefreshHandler()
- type Airs
- type CalendarMovie
- type CalendarShow
- type Code
- type CollectedEpisode
- type CollectedSeason
- type CollectionMovie
- type CollectionShow
- type Episode
- func GetEpisode(showID, seasonNumber, episodeNumber int) (episode *Episode)
- func GetEpisodeByID(id string) (episode *Episode)
- func GetEpisodeByTMDB(tmdbID string) (episode *Episode)
- func GetEpisodeByTVDB(tvdbID string) (episode *Episode)
- func GetSeasonEpisodes(showID, seasonNumber int) (episodes []*Episode)
- type EpisodeSearchResults
- type IDs
- type Images
- type List
- type ListContainer
- type ListItem
- type ListItemsPayload
- type Movie
- type MovieSearchResults
- type Movies
- func CollectionMovies(isUpdateNeeded bool) (movies []*Movies, err error)
- func DiffMovies(previous, current []*Movies) []*Movies
- func ListItemsMovies(user string, listID string, isUpdateNeeded bool) (movies []*Movies, err error)
- func SearchMovies(query string, page string) (movies []*Movies, err error)
- func TopMovies(topCategory string, page string) (movies []*Movies, total int, err error)
- func WatchlistMovies(isUpdateNeeded bool) (movies []*Movies, err error)
- type Object
- type Pagination
- type PausedEpisode
- type PausedMovie
- type ProgressShow
- type Season
- type Show
- type ShowSearchResults
- type Shows
- func CollectionShows(isUpdateNeeded bool) (shows []*Shows, err error)
- func ListItemsShows(listID string, isUpdateNeeded bool) (shows []*Shows, err error)
- func PreviousCollectionShows() (shows []*Shows, err error)
- func PreviousListItemsShows(listID string) (shows []*Shows, err error)
- func PreviousWatchlistShows() (shows []*Shows, err error)
- func SearchShows(query string, page string) (shows []*Shows, err error)
- func TopShows(topCategory string, page string) (shows []*Shows, total int, err error)
- func WatchlistShows(isUpdateNeeded bool) (shows []*Shows, err error)
- type Sizes
- type Token
- type TokenRefresh
- type User
- type UserActivities
- type UserSettings
- type WatchedEpisode
- type WatchedItem
- type WatchedMovie
- type WatchedProgressShow
- type WatchedSeason
- type WatchedShow
- type Watchlist
- type WatchlistEpisode
- type WatchlistMovie
- type WatchlistSeason
- type WatchlistShow
Constants ¶
const ( // APIURL ... APIURL = "https://api.trakt.tv" // APIVersion ... APIVersion = "2" )
const ( // ProgressSortWatched ... ProgressSortWatched = iota // ProgressSortShow ... ProgressSortShow // ProgressSortAiredNewer ... ProgressSortAiredNewer // ProgressSortAiredOlder ... ProgressSortAiredOlder )
Variables ¶
var ( // Cookies ... Cookies = "" // UserAgent ... UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.21 Safari/537.36" )
var (
// PagesAtOnce ...
PagesAtOnce = 5
)
Functions ¶
func AddToCollection ¶
AddToCollection ...
func AddToUserlist ¶
AddToUserlist ...
func AddToWatchlist ¶
AddToWatchlist ...
func GetWithAuth ¶
GetWithAuth ...
func RemoveFromCollection ¶
RemoveFromCollection ...
func RemoveFromUserlist ¶
func RemoveFromUserlist(listID int, itemType string, tmdbID string) (resp *napping.Response, err error)
RemoveFromUserlist ...
func RemoveFromWatchlist ¶
RemoveFromWatchlist ...
func Request ¶
func Request(endPoint string, params napping.Params, isWithAuth bool, isUpdateNeeded bool, cacheKey string, cacheExpiration time.Duration, ret interface{}) error
Request is a general proxy for making requests
func SetMultipleWatched ¶
func SetMultipleWatched(items []*WatchedItem) (resp *napping.Response, err error)
SetMultipleWatched adds and removes from watched history
func SetWatched ¶
func SetWatched(item *WatchedItem) (resp *napping.Response, err error)
SetWatched addes and removes from watched history
func SyncAddedItem ¶
func SyncAddedItem(itemType string, tmdbID string, location int) (resp *napping.Response, err error)
SyncAddedItem adds item (movie/show) to watchlist or collection
Types ¶
type Airs ¶
type Airs struct {
Day string `json:"day"`
Time string `json:"time"`
Timezone string `json:"timezone"`
}
Airs ...
func (Airs) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type CalendarMovie ¶
CalendarMovie ...
func CalendarMovies ¶
func CalendarMovies(endPoint string, page string) (movies []*CalendarMovie, total int, err error)
CalendarMovies ...
func (*CalendarMovie) MarshalMsg ¶
func (z *CalendarMovie) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*CalendarMovie) Msgsize ¶
func (z *CalendarMovie) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CalendarMovie) UnmarshalMsg ¶
func (z *CalendarMovie) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CalendarShow ¶
type CalendarShow struct {
FirstAired string `json:"first_aired"`
Episode *Episode `json:"episode"`
Show *Show `json:"show"`
}
CalendarShow ...
func CalendarShows ¶
func CalendarShows(endPoint string, page string) (shows []*CalendarShow, total int, err error)
CalendarShows ...
func (*CalendarShow) MarshalMsg ¶
func (z *CalendarShow) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*CalendarShow) Msgsize ¶
func (z *CalendarShow) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CalendarShow) UnmarshalMsg ¶
func (z *CalendarShow) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Code ¶
type Code struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURL string `json:"verification_url"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
}
Code ...
func (*Code) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type CollectedEpisode ¶
type CollectedEpisode struct {
CollectedAt string `json:"collected_at"`
Number int `json:"number"`
}
CollectedEpisode ...
func (CollectedEpisode) MarshalMsg ¶
func (z CollectedEpisode) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (CollectedEpisode) Msgsize ¶
func (z CollectedEpisode) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CollectedEpisode) UnmarshalMsg ¶
func (z *CollectedEpisode) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CollectedSeason ¶
type CollectedSeason struct {
Number int `json:"number"`
Episodes []*CollectedEpisode `json:"episodes"`
}
CollectedSeason ...
func (*CollectedSeason) MarshalMsg ¶
func (z *CollectedSeason) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*CollectedSeason) Msgsize ¶
func (z *CollectedSeason) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CollectedSeason) UnmarshalMsg ¶
func (z *CollectedSeason) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CollectionMovie ¶
type CollectionMovie struct {
CollectedAt time.Time `json:"collected_at"`
Movie *Movie `json:"movie"`
}
CollectionMovie ...
func (*CollectionMovie) MarshalMsg ¶
func (z *CollectionMovie) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*CollectionMovie) Msgsize ¶
func (z *CollectionMovie) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CollectionMovie) UnmarshalMsg ¶
func (z *CollectionMovie) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CollectionShow ¶
type CollectionShow struct {
CollectedAt time.Time `json:"last_collected_at"`
Show *Show `json:"show"`
Seasons []*CollectedSeason `json:"seasons"`
}
CollectionShow ...
func (*CollectionShow) MarshalMsg ¶
func (z *CollectionShow) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*CollectionShow) Msgsize ¶
func (z *CollectionShow) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CollectionShow) UnmarshalMsg ¶
func (z *CollectionShow) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Episode ¶
type Episode struct {
// Show *Show `json:"-"`
// Season *ShowSeason `json:"-"`
Number int `json:"number"`
Season int `json:"season"`
Title string `json:"title"`
Overview string `json:"overview"`
Absolute int `json:"number_abs"`
FirstAired string `json:"first_aired"`
Translations []string `json:"available_translations"`
Runtime int `json:"runtime"`
Rating float32 `json:"rating"`
Votes int `json:"votes"`
Images *Images `json:"images"`
IDs *IDs `json:"ids"`
}
Episode ...
func GetEpisode ¶
GetEpisode ...
func GetEpisodeByTMDB ¶
GetEpisodeByTMDB ...
func GetEpisodeByTVDB ¶
GetEpisodeByTVDB ...
func GetSeasonEpisodes ¶
GetSeasonEpisodes ...
func (*Episode) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Episode) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Episode) ToListItem ¶
ToListItem ...
type EpisodeSearchResults ¶
type EpisodeSearchResults []struct {
Type string `json:"type"`
Score interface{} `json:"score"`
Episode *Episode
Show *Show
}
EpisodeSearchResults ...
func (EpisodeSearchResults) MarshalMsg ¶
func (z EpisodeSearchResults) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (EpisodeSearchResults) Msgsize ¶
func (z EpisodeSearchResults) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*EpisodeSearchResults) UnmarshalMsg ¶
func (z *EpisodeSearchResults) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type IDs ¶
type IDs struct {
Trakt int `json:"trakt"`
IMDB string `json:"imdb"`
TMDB int `json:"tmdb"`
TVDB int `json:"tvdb"`
TVRage int `json:"tvrage"`
Slug string `json:"slug"`
}
IDs ...
func (*IDs) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Images ¶
type Images struct {
Poster *Sizes `json:"poster"`
FanArt *Sizes `json:"fanart"`
ScreenShot *Sizes `json:"screenshot"`
HeadShot *Sizes `json:"headshot"`
Logo *Sizes `json:"logo"`
ClearArt *Sizes `json:"clearart"`
Banner *Sizes `json:"banner"`
Thumbnail *Sizes `json:"thumb"`
Avatar *Sizes `json:"avatar"`
}
Images ...
func (*Images) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type List ¶
type List struct {
Name string `json:"name"`
Description string `json:"description"`
Privacy string `json:"privacy"`
DisplayNumbers bool `json:"display_numbers"`
AllowComments bool `json:"allow_comments"`
SortBy string `json:"sort_by"`
SortHow string `json:"sort_how"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ItemCount int `json:"item_count"`
CommentCount int `json:"comment_count"`
Likes int `json:"likes"`
IDs *IDs `json:"IDs"`
User *User `json:"User"`
}
List ...
func (*List) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type ListContainer ¶
type ListContainer struct {
LikeCount int `json:"like_count"`
CommentCount int `json:"comment_count"`
LikedAt time.Time `json:"liked_at"`
Type string `json:"type"`
List *List `json:"list"`
}
ListContainer ...
func (*ListContainer) MarshalMsg ¶
func (z *ListContainer) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ListContainer) Msgsize ¶
func (z *ListContainer) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ListContainer) UnmarshalMsg ¶
func (z *ListContainer) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type ListItem ¶
type ListItem struct {
Rank int `json:"rank"`
ListedAt string `json:"listed_at"`
Type string `json:"type"`
Movie *Movie `json:"movie"`
Show *Show `json:"show"`
}
ListItem ...
func (*ListItem) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type ListItemsPayload ¶
type ListItemsPayload struct {
Movies []*Movie `json:"movies,omitempty"`
Shows []*Show `json:"shows,omitempty"`
}
ListItemsPayload describes items to add/remove from userlists
func (*ListItemsPayload) MarshalMsg ¶
func (z *ListItemsPayload) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ListItemsPayload) Msgsize ¶
func (z *ListItemsPayload) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ListItemsPayload) UnmarshalMsg ¶
func (z *ListItemsPayload) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Movie ¶
type Movie struct {
Object
Released string `json:"released"`
URL string `json:"homepage"`
Trailer string `json:"trailer"`
Runtime int `json:"runtime"`
TagLine string `json:"tagline"`
Overview string `json:"overview"`
Certification string `json:"certification"`
Rating float32 `json:"rating"`
Votes int `json:"votes"`
Genres []string `json:"genres"`
Language string `json:"language"`
Translations []string `json:"available_translations"`
Images *Images `json:"images"`
}
Movie ...
func (*Movie) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type MovieSearchResults ¶
type MovieSearchResults []struct {
Type string `json:"type"`
Score interface{} `json:"score"`
Movie *Movie `json:"movie"`
}
MovieSearchResults ...
func (MovieSearchResults) MarshalMsg ¶
func (z MovieSearchResults) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (MovieSearchResults) Msgsize ¶
func (z MovieSearchResults) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MovieSearchResults) UnmarshalMsg ¶
func (z *MovieSearchResults) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Movies ¶
Movies ...
func CollectionMovies ¶
CollectionMovies ...
func ListItemsMovies ¶
ListItemsMovies ...
func SearchMovies ¶
SearchMovies ...
func WatchlistMovies ¶
WatchlistMovies ...
func (*Movies) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Object ¶
type Object struct {
Title string `json:"title"`
Year int `json:"year"`
IDs *IDs `json:"ids"`
UpdatedAt time.Time `json:"updated_at"`
}
Object ...
func (*Object) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Pagination ¶
type Pagination struct {
ItemCount int `json:"x_pagination_item_count"`
Limit int `json:"x_pagination_limit"`
Page int `json:"x_pagination_page"`
PageCount int `json:"x_pagination_page_count"`
}
Pagination ...
func (*Pagination) MarshalMsg ¶
func (z *Pagination) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*Pagination) Msgsize ¶
func (z *Pagination) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Pagination) UnmarshalMsg ¶
func (z *Pagination) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PausedEpisode ¶
type PausedEpisode struct {
Progress float64 `json:"progress"`
PausedAt time.Time `json:"paused_at"`
ID int `json:"id"`
Type string `json:"type"`
Episode *Episode `json:"episode"`
Show *Show `json:"show"`
}
PausedEpisode represents paused episode with show information
func (*PausedEpisode) MarshalMsg ¶
func (z *PausedEpisode) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PausedEpisode) Msgsize ¶
func (z *PausedEpisode) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PausedEpisode) UnmarshalMsg ¶
func (z *PausedEpisode) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PausedMovie ¶
type PausedMovie struct {
Progress float64 `json:"progress"`
PausedAt time.Time `json:"paused_at"`
ID int `json:"id"`
Type string `json:"type"`
Movie *Movie `json:"movie"`
}
PausedMovie represents paused movie
func (*PausedMovie) MarshalMsg ¶
func (z *PausedMovie) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PausedMovie) Msgsize ¶
func (z *PausedMovie) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PausedMovie) UnmarshalMsg ¶
func (z *PausedMovie) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type ProgressShow ¶
ProgressShow ...
func WatchedShowsProgress ¶
func WatchedShowsProgress() (shows []*ProgressShow, err error)
WatchedShowsProgress ...
func (*ProgressShow) MarshalMsg ¶
func (z *ProgressShow) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ProgressShow) Msgsize ¶
func (z *ProgressShow) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ProgressShow) UnmarshalMsg ¶
func (z *ProgressShow) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Season ¶
type Season struct {
// Show *Show `json:"-"`
Number int `json:"number"`
Overview string `json:"overview"`
EpisodeCount int `json:"episode_count"`
AiredEpisodes int `json:"aired_episodes"`
Rating float32 `json:"rating"`
Votes int `json:"votes"`
Images *Images `json:"images"`
IDs *IDs `json:"ids"`
}
Season ...
func (*Season) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Show ¶
type Show struct {
Object
FirstAired string `json:"first_aired"`
URL string `json:"homepage"`
Trailer string `json:"trailer"`
Runtime int `json:"runtime"`
Overview string `json:"overview"`
Certification string `json:"certification"`
Status string `json:"status"`
Network string `json:"network"`
AiredEpisodes int `json:"aired_episodes"`
Airs *Airs `json:"airs"`
Rating float32 `json:"rating"`
Votes int `json:"votes"`
Genres []string `json:"genres"`
Country string `json:"country"`
Language string `json:"language"`
Translations []string `json:"available_translations"`
Images *Images `json:"images"`
}
Show ...
func (*Show) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type ShowSearchResults ¶
type ShowSearchResults []struct {
Type string `json:"type"`
Score interface{} `json:"score"`
Show *Show `json:"show"`
}
ShowSearchResults ...
func (ShowSearchResults) MarshalMsg ¶
func (z ShowSearchResults) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (ShowSearchResults) Msgsize ¶
func (z ShowSearchResults) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ShowSearchResults) UnmarshalMsg ¶
func (z *ShowSearchResults) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Shows ¶
Shows ...
func CollectionShows ¶
CollectionShows ...
func ListItemsShows ¶
ListItemsShows ...
func PreviousCollectionShows ¶
PreviousCollectionShows ...
func PreviousListItemsShows ¶
PreviousListItemsShows ...
func PreviousWatchlistShows ¶
PreviousWatchlistShows ...
func SearchShows ¶
SearchShows ... TODO: Actually use this somewhere
func WatchlistShows ¶
WatchlistShows ...
func (*Shows) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Sizes ¶
type Sizes struct {
Full string `json:"full"`
Medium string `json:"medium"`
Thumbnail string `json:"thumb"`
}
Sizes ...
func (Sizes) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Token ¶
type Token struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
Scope string `json:"scope"`
}
Token ...
func (*Token) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type TokenRefresh ¶
type TokenRefresh struct {
RefreshToken string `json:"refresh_token"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
RedirectURI string `json:"redirect_uri"`
GrantType string `json:"grant_type"`
}
TokenRefresh ...
func (*TokenRefresh) MarshalMsg ¶
func (z *TokenRefresh) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*TokenRefresh) Msgsize ¶
func (z *TokenRefresh) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*TokenRefresh) UnmarshalMsg ¶
func (z *TokenRefresh) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type User ¶
type User struct {
Username string `json:"username"`
Private bool `json:"private"`
Name string `json:"name"`
Vip bool `json:"vip"`
VipEp bool `json:"vip_ep"`
Ids struct {
Slug string `json:"slug"`
} `json:"ids"`
}
User ...
func (*User) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type UserActivities ¶
type UserActivities struct {
All time.Time `json:"all"`
Movies struct {
WatchedAt time.Time `json:"watched_at"`
CollectedAt time.Time `json:"collected_at"`
RatedAt time.Time `json:"rated_at"`
WatchlistedAt time.Time `json:"watchlisted_at"`
CommentedAt time.Time `json:"commented_at"`
PausedAt time.Time `json:"paused_at"`
HiddenAt time.Time `json:"hidden_at"`
} `json:"movies"`
Episodes struct {
WatchedAt time.Time `json:"watched_at"`
CollectedAt time.Time `json:"collected_at"`
RatedAt time.Time `json:"rated_at"`
WatchlistedAt time.Time `json:"watchlisted_at"`
CommentedAt time.Time `json:"commented_at"`
PausedAt time.Time `json:"paused_at"`
} `json:"episodes"`
Shows struct {
RatedAt time.Time `json:"rated_at"`
WatchlistedAt time.Time `json:"watchlisted_at"`
CommentedAt time.Time `json:"commented_at"`
HiddenAt time.Time `json:"hidden_at"`
} `json:"shows"`
Seasons struct {
RatedAt time.Time `json:"rated_at"`
WatchlistedAt time.Time `json:"watchlisted_at"`
CommentedAt time.Time `json:"commented_at"`
HiddenAt time.Time `json:"hidden_at"`
} `json:"seasons"`
Comments struct {
LikedAt time.Time `json:"liked_at"`
} `json:"comments"`
Lists struct {
LikedAt time.Time `json:"liked_at"`
UpdatedAt time.Time `json:"updated_at"`
CommentedAt time.Time `json:"commented_at"`
} `json:"lists"`
}
UserActivities is a structure, returned by sync/last_activities
func GetLastActivities ¶
func GetLastActivities() (a *UserActivities, err error)
GetLastActivities ...
func (*UserActivities) MarshalMsg ¶
func (z *UserActivities) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*UserActivities) Msgsize ¶
func (z *UserActivities) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*UserActivities) UnmarshalMsg ¶
func (z *UserActivities) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type UserSettings ¶
type UserSettings struct {
User User `json:"user"`
Account struct{} `json:"account"`
}
UserSettings ...
func (*UserSettings) MarshalMsg ¶
func (z *UserSettings) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*UserSettings) Msgsize ¶
func (z *UserSettings) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*UserSettings) UnmarshalMsg ¶
func (z *UserSettings) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchedEpisode ¶
type WatchedEpisode struct {
Number int `json:"number"`
Plays int `json:"plays"`
LastWatchedAt time.Time `json:"last_watched_at"`
}
WatchedEpisode ...
func (WatchedEpisode) MarshalMsg ¶
func (z WatchedEpisode) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (WatchedEpisode) Msgsize ¶
func (z WatchedEpisode) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchedEpisode) UnmarshalMsg ¶
func (z *WatchedEpisode) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchedItem ¶
type WatchedItem struct {
MediaType string
KodiID int
Movie int
Show int
Season int
Episode int
Watched bool
WatchedAt time.Time
}
WatchedItem represents possible watched add/delete item
func (*WatchedItem) MarshalMsg ¶
func (z *WatchedItem) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchedItem) Msgsize ¶
func (z *WatchedItem) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchedItem) String ¶
func (item *WatchedItem) String() (query string)
func (*WatchedItem) UnmarshalMsg ¶
func (z *WatchedItem) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchedMovie ¶
type WatchedMovie struct {
Plays int `json:"plays"`
LastWatchedAt time.Time `json:"last_watched_at"`
Movie *Movie `json:"movie"`
}
WatchedMovie ...
func DiffWatchedMovies ¶
func DiffWatchedMovies(previous, current []*WatchedMovie) []*WatchedMovie
DiffWatchedMovies ...
func PreviousWatchedMovies ¶
func PreviousWatchedMovies() (movies []*WatchedMovie, err error)
PreviousWatchedMovies ...
func WatchedMovies ¶
func WatchedMovies(isUpdateNeeded bool) ([]*WatchedMovie, error)
WatchedMovies ...
func (*WatchedMovie) MarshalMsg ¶
func (z *WatchedMovie) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchedMovie) Msgsize ¶
func (z *WatchedMovie) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchedMovie) UnmarshalMsg ¶
func (z *WatchedMovie) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchedProgressShow ¶
type WatchedProgressShow struct {
Aired int `json:"aired"`
Completed int `json:"completed"`
LastWatchedAt time.Time `json:"last_watched_at"`
Seasons []*Season `json:"seasons"`
HiddenSeasons []*Season `json:"hidden_seasons"`
NextEpisode *Episode `json:"next_episode"`
LastEpisode *Episode `json:"last_episode"`
}
WatchedProgressShow ...
func (*WatchedProgressShow) MarshalMsg ¶
func (z *WatchedProgressShow) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchedProgressShow) Msgsize ¶
func (z *WatchedProgressShow) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchedProgressShow) UnmarshalMsg ¶
func (z *WatchedProgressShow) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchedSeason ¶
type WatchedSeason struct {
Plays int `json:"plays"`
Number int `json:"number"`
Episodes []*WatchedEpisode `json:"episodes"`
}
WatchedSeason ...
func (*WatchedSeason) MarshalMsg ¶
func (z *WatchedSeason) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchedSeason) Msgsize ¶
func (z *WatchedSeason) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchedSeason) UnmarshalMsg ¶
func (z *WatchedSeason) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchedShow ¶
type WatchedShow struct {
Plays int `json:"plays"`
Watched bool
LastWatchedAt time.Time `json:"last_watched_at"`
Show *Show `json:"show"`
Seasons []*WatchedSeason `json:"seasons"`
}
WatchedShow ...
func DiffWatchedShows ¶
func DiffWatchedShows(current, previous []*WatchedShow) (diff []*WatchedShow)
DiffWatchedShows ...
func PreviousWatchedShows ¶
func PreviousWatchedShows() (shows []*WatchedShow, err error)
PreviousWatchedShows ...
func (*WatchedShow) MarshalMsg ¶
func (z *WatchedShow) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchedShow) Msgsize ¶
func (z *WatchedShow) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchedShow) UnmarshalMsg ¶
func (z *WatchedShow) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Watchlist ¶
type Watchlist struct {
Movies []*Movie `json:"movies"`
Shows []*Show `json:"shows"`
Episodes []*Episode `json:"episodes"`
}
Watchlist ...
func (*Watchlist) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type WatchlistEpisode ¶
type WatchlistEpisode struct {
ListedAt string `json:"listed_at"`
Type string `json:"type"`
Episode *Episode `json:"episode"`
Show *Object `json:"show"`
}
WatchlistEpisode ...
func (*WatchlistEpisode) MarshalMsg ¶
func (z *WatchlistEpisode) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchlistEpisode) Msgsize ¶
func (z *WatchlistEpisode) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchlistEpisode) UnmarshalMsg ¶
func (z *WatchlistEpisode) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchlistMovie ¶
type WatchlistMovie struct {
ListedAt string `json:"listed_at"`
Type string `json:"type"`
Movie *Movie `json:"movie"`
}
WatchlistMovie ...
func (*WatchlistMovie) MarshalMsg ¶
func (z *WatchlistMovie) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchlistMovie) Msgsize ¶
func (z *WatchlistMovie) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchlistMovie) UnmarshalMsg ¶
func (z *WatchlistMovie) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchlistSeason ¶
type WatchlistSeason struct {
ListedAt string `json:"listed_at"`
Type string `json:"type"`
Season *Object `json:"season"`
Show *Object `json:"show"`
}
WatchlistSeason ...
func (*WatchlistSeason) MarshalMsg ¶
func (z *WatchlistSeason) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchlistSeason) Msgsize ¶
func (z *WatchlistSeason) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchlistSeason) UnmarshalMsg ¶
func (z *WatchlistSeason) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type WatchlistShow ¶
type WatchlistShow struct {
ListedAt string `json:"listed_at"`
Type string `json:"type"`
Show *Show `json:"show"`
}
WatchlistShow ...
func (*WatchlistShow) MarshalMsg ¶
func (z *WatchlistShow) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WatchlistShow) Msgsize ¶
func (z *WatchlistShow) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WatchlistShow) UnmarshalMsg ¶
func (z *WatchlistShow) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler