trakt

package
v0.1.102 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIURL ...
	APIURL = "https://api.trakt.tv"
	// APIVersion ...
	APIVersion = "2"

	ListsPerPage = 150
)
View Source
const (
	// ProgressSortWatched ...
	ProgressSortWatched = iota
	// ProgressSortShow ...
	ProgressSortShow
	// ProgressSortAiredNewer ...
	ProgressSortAiredNewer
	// ProgressSortAiredOlder ...
	ProgressSortAiredOlder
)

Variables

View Source
var (
	// Cookies ...
	Cookies = ""
	// UserAgent ...
	UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
)
View Source
var (
	// ErrLocked reflects Trakt account locked status
	ErrLocked = errors.New("Account is locked")
)

Functions

func AddToCollection

func AddToCollection(itemType string, tmdbID string) (req *reqapi.Request, err error)

AddToCollection ...

func AddToUserlist

func AddToUserlist(listID int, itemType string, tmdbID string) (req *reqapi.Request, err error)

AddToUserlist ...

func AddToWatchlist

func AddToWatchlist(itemType string, tmdbID string) (req *reqapi.Request, err error)

AddToWatchlist ...

func Authorize

func Authorize(fromSettings bool) error

Authorize ...

func Authorized

func Authorized() error

Authorized ...

func Deauthorize

func Deauthorize(fromSettings bool) error

Deauthorize ...

func GetAuthenticatedHeader

func GetAuthenticatedHeader() http.Header

func GetAvailableHeader

func GetAvailableHeader() http.Header

func GetHeader

func GetHeader() http.Header

func GetHiddenShowsMap

func GetHiddenShowsMap(section string) map[int]bool

GetHiddenShowsMap returns a map with hidden shows that can be used for filtering

func NotifyLocked

func NotifyLocked()

NotifyLocked ...

func RemoveFromCollection

func RemoveFromCollection(itemType string, tmdbID string) (req *reqapi.Request, err error)

RemoveFromCollection ...

func RemoveFromUserlist

func RemoveFromUserlist(listID int, itemType string, tmdbID string) (req *reqapi.Request, err error)

RemoveFromUserlist ...

func RemoveFromWatchlist

func RemoveFromWatchlist(itemType string, tmdbID string) (req *reqapi.Request, err error)

RemoveFromWatchlist ...

func Request

func Request(endPoint string, params napping.Params, isWithAuth bool, isUpdateNeeded bool, cacheExpiration time.Duration, ret interface{}) error

Request is a general proxy for making requests

func Scrobble

func Scrobble(action string, contentType string, tmdbID int, watched float64, runtime float64)

Scrobble ...

func SetWatched

func SetWatched(item *WatchedItem) (req *reqapi.Request, err error)

SetWatched adds and removes from watched history

func SyncAddedItem

func SyncAddedItem(itemType string, tmdbID string, location int) (req *reqapi.Request, err error)

SyncAddedItem adds item (movie/show) to watchlist or collection

func SyncRemovedItem

func SyncRemovedItem(itemType string, tmdbID string, location int) (req *reqapi.Request, err error)

SyncRemovedItem removes item (movie/show) from watchlist or collection

func TokenRefreshHandler

func TokenRefreshHandler()

TokenRefreshHandler ...

Types

type Activities

type Activities struct {
	Previous *UserActivities
	Current  *UserActivities
	// contains filtered or unexported fields
}

func GetActivities

func GetActivities(source string) (*Activities, error)

func (*Activities) All

func (a *Activities) All() bool

func (*Activities) EpisodesCollected

func (a *Activities) EpisodesCollected() bool

func (*Activities) EpisodesCommented

func (a *Activities) EpisodesCommented() bool

func (*Activities) EpisodesPaused

func (a *Activities) EpisodesPaused() bool

func (*Activities) EpisodesRated

func (a *Activities) EpisodesRated() bool

func (*Activities) EpisodesWatched

func (a *Activities) EpisodesWatched() bool

func (*Activities) EpisodesWatchlisted

func (a *Activities) EpisodesWatchlisted() bool

func (*Activities) FavoritesUpdated

func (a *Activities) FavoritesUpdated() bool

func (*Activities) HasPrevious

func (a *Activities) HasPrevious() bool

func (*Activities) ListsCommented

func (a *Activities) ListsCommented() bool

func (*Activities) ListsLiked

func (a *Activities) ListsLiked() bool

func (*Activities) ListsUpdated

func (a *Activities) ListsUpdated() bool

func (*Activities) MoviesCollected

func (a *Activities) MoviesCollected() bool

func (*Activities) MoviesCommented

func (a *Activities) MoviesCommented() bool

func (*Activities) MoviesFavorited

func (a *Activities) MoviesFavorited() bool

func (*Activities) MoviesHidden

func (a *Activities) MoviesHidden() bool

func (*Activities) MoviesPaused

func (a *Activities) MoviesPaused() bool

func (*Activities) MoviesRated

func (a *Activities) MoviesRated() bool

func (*Activities) MoviesWatched

func (a *Activities) MoviesWatched() bool

func (*Activities) MoviesWatchlisted

func (a *Activities) MoviesWatchlisted() bool

func (*Activities) SaveCurrent

func (a *Activities) SaveCurrent() error

func (*Activities) SeasonsCommented

func (a *Activities) SeasonsCommented() bool

func (*Activities) SeasonsHidden

func (a *Activities) SeasonsHidden() bool

func (*Activities) SeasonsRated

func (a *Activities) SeasonsRated() bool

func (*Activities) SeasonsWatchlisted

func (a *Activities) SeasonsWatchlisted() bool

func (*Activities) ShowsCommented

func (a *Activities) ShowsCommented() bool

func (*Activities) ShowsFavorited

func (a *Activities) ShowsFavorited() bool

func (*Activities) ShowsHidden

func (a *Activities) ShowsHidden() bool

func (*Activities) ShowsRated

func (a *Activities) ShowsRated() bool

func (*Activities) ShowsWatchlisted

func (a *Activities) ShowsWatchlisted() bool

func (*Activities) WatchlistUpdated

func (a *Activities) WatchlistUpdated() bool

type Airs

type Airs struct {
	Day      string `json:"day"`
	Time     string `json:"time"`
	Timezone string `json:"timezone"`
}

Airs ...

type CalendarMovie

type CalendarMovie struct {
	Released string `json:"released"`
	Movie    *Movie `json:"movie"`
}

CalendarMovie ...

func CalendarMovies

func CalendarMovies(endPoint string, page string, cacheExpire time.Duration, isUpdateNeeded bool) (movies []*CalendarMovie, total int, err error)

CalendarMovies ...

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, cacheExpire time.Duration, isUpdateNeeded bool) (shows []*CalendarShow, total int, err error)

CalendarShows ...

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 GetCode

func GetCode() (code *Code, err error)

GetCode ...

type CollectedEpisode

type CollectedEpisode struct {
	CollectedAt time.Time `json:"collected_at"`
	Number      int       `json:"number"`
}

CollectedEpisode ...

type CollectedSeason

type CollectedSeason struct {
	Number   int                 `json:"number"`
	Episodes []*CollectedEpisode `json:"episodes"`
}

CollectedSeason ...

type CollectionMovie

type CollectionMovie struct {
	CollectedAt time.Time `json:"collected_at"`
	Movie       *Movie    `json:"movie"`
}

CollectionMovie ...

type CollectionShow

type CollectionShow struct {
	CollectedAt time.Time          `json:"last_collected_at"`
	Show        *Show              `json:"show"`
	Seasons     []*CollectedSeason `json:"seasons"`
}

CollectionShow ...

type Episode

type Episode struct {
	// Show          *Show       `json:"-"`
	// Season        *ShowSeason `json:"-"`
	Absolute     int      `json:"number_abs"`
	FirstAired   string   `json:"first_aired"`
	Number       int      `json:"number"`
	Overview     string   `json:"overview"`
	Season       int      `json:"season"`
	Title        string   `json:"title"`
	Translations []string `json:"available_translations"`

	Runtime int     `json:"runtime"`
	Rating  float32 `json:"rating"`
	Votes   int     `json:"votes"`

	IDs *IDs `json:"ids"`
}

Episode ...

func GetEpisode

func GetEpisode(showID, seasonNumber, episodeNumber int) (episode *Episode)

GetEpisode ...

func GetEpisodeByID

func GetEpisodeByID(id string) (episode *Episode)

GetEpisodeByID ...

func GetEpisodeByTMDB

func GetEpisodeByTMDB(tmdbID string) (episode *Episode)

GetEpisodeByTMDB ...

func GetEpisodeByTVDB

func GetEpisodeByTVDB(tvdbID string) (episode *Episode)

GetEpisodeByTVDB ...

func GetSeasonEpisodes

func GetSeasonEpisodes(showID, seasonNumber int) (episodes []*Episode)

GetSeasonEpisodes ...

func (*Episode) ToListItem

func (episode *Episode) ToListItem(show *Show, tmdbShow *tmdb.Show) (item *xbmc.ListItem)

ToListItem ...

type EpisodeSearchResults

type EpisodeSearchResults []struct {
	Type    string      `json:"type"`
	Score   interface{} `json:"score"`
	Episode *Episode
	Show    *Show
}

EpisodeSearchResults ...

type HiddenShow

type HiddenShow struct {
	HiddenAt time.Time `json:"hidden_at"`
	Type     string    `json:"type"`
	Show     *Show     `json:"show"`
}

HiddenShow ...

type HistoryResponse

type HistoryResponse struct {
	Added    HistoryResponseStats `json:"added"`
	Deleted  HistoryResponseStats `json:"deleted"`
	NotFound struct {
		Movies []struct {
			IDs *IDs `json:"IDs"`
		} `json:"movies"`
		Shows []struct {
			IDs *IDs `json:"IDs"`
		} `json:"shows"`
		Seasons []struct {
			IDs *IDs `json:"IDs"`
		} `json:"seasons"`
		Episodes []struct {
			IDs *IDs `json:"IDs"`
		} `json:"episodes"`
		Ids []int `json:"ids"`
	} `json:"not_found"`
}

HistoryResponse reflects response from History remove

func SetMultipleWatched

func SetMultipleWatched(items []*WatchedItem) (*HistoryResponse, error)

SetMultipleWatched adds and removes from watched history

type HistoryResponseStats

type HistoryResponseStats struct {
	Movies   int `json:"movies"`
	Episodes int `json:"episodes"`
}

HistoryResponseStats refrects stats for each action type

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) ToUniqueIDs

func (id *IDs) ToUniqueIDs() *uid.UniqueIDs

type List

type List struct {
	Name           string    `json:"name"`
	Description    string    `json:"description"`
	Privacy        string    `json:"privacy"`
	Type           string    `json:"type"`
	DisplayNumbers bool      `json:"display_numbers"`
	AllowComments  bool      `json:"allow_comments"`
	SortBy         string    `json:"sort_by"`
	SortHow        string    `json:"sort_how"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `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 GetList

func GetList(user, listID string) (list *List, err error)

func Likedlists

func Likedlists() (lists []*List)

Likedlists ...

func Userlists

func Userlists() (lists []*List)

Userlists ...

func (*List) ID

func (l *List) ID() int

func (*List) IsOfficial

func (l *List) IsOfficial() bool

func (*List) IsOur

func (l *List) IsOur() bool

func (*List) IsPersonal

func (l *List) IsPersonal() bool

func (*List) IsPrivate

func (l *List) IsPrivate() bool

func (*List) IsPublic

func (l *List) IsPublic() bool

func (*List) Username

func (l *List) Username() string

type ListActivities

type ListActivities struct {
	Previous *List
	Current  *List
	// contains filtered or unexported fields
}

func GetListActivities

func GetListActivities(user, listID string) (*ListActivities, error)

func (*ListActivities) HasCurrent

func (a *ListActivities) HasCurrent() bool

func (*ListActivities) HasPrevious

func (a *ListActivities) HasPrevious() bool

func (*ListActivities) IsUpdated

func (a *ListActivities) IsUpdated() bool

func (*ListActivities) SaveCurrent

func (a *ListActivities) SaveCurrent() error

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 TopLists

func TopLists(page string) (lists []*ListContainer, hasNext bool)

TopLists ...

type ListItem

type ListItem struct {
	Rank     int       `json:"rank"`
	ListedAt time.Time `json:"listed_at"`
	Type     string    `json:"type"`
	Movie    *Movie    `json:"movie"`
	Show     *Show     `json:"show"`
}

ListItem ...

type ListItemsPayload

type ListItemsPayload struct {
	Movies []*Movie `json:"movies,omitempty"`
	Shows  []*Show  `json:"shows,omitempty"`
}

ListItemsPayload describes items to add/remove from userlists

type Movie

type Movie struct {
	Object

	Certification string   `json:"certification"`
	Genres        []string `json:"genres"`
	Language      string   `json:"language"`
	Overview      string   `json:"overview"`
	Rating        float32  `json:"rating"`
	Released      string   `json:"released"`
	Runtime       int      `json:"runtime"`
	TagLine       string   `json:"tagline"`
	Trailer       string   `json:"trailer"`
	Translations  []string `json:"available_translations"`
	URL           string   `json:"homepage"`
	Votes         int      `json:"votes"`
}

Movie ...

func GetMovie

func GetMovie(ID string) (movie *Movie)

GetMovie ...

func GetMovieByTMDB

func GetMovieByTMDB(tmdbID string) (movie *Movie)

GetMovieByTMDB ...

func (*Movie) ToListItem

func (movie *Movie) ToListItem() (item *xbmc.ListItem)

ToListItem ...

type MovieSearchResults

type MovieSearchResults []struct {
	Type  string      `json:"type"`
	Score interface{} `json:"score"`
	Movie *Movie      `json:"movie"`
}

MovieSearchResults ...

type Movies

type Movies struct {
	Watchers int    `json:"watchers"`
	Movie    *Movie `json:"movie"`
}

Movies ...

func CollectionMovies

func CollectionMovies(isUpdateNeeded bool) (movies []*Movies, err error)

CollectionMovies ...

func DiffMovies

func DiffMovies(previous, current []*Movies) []*Movies

DiffMovies ...

func ListItemsMovies

func ListItemsMovies(user, listID string) (movies []*Movies, err error)

ListItemsMovies ...

func PreviousCollectionMovies

func PreviousCollectionMovies() (movies []*Movies, err error)

PreviousCollectionMovies ...

func PreviousListItemsMovies

func PreviousListItemsMovies(listID string) (movies []*Movies, err error)

PreviousListItemsMovies ...

func PreviousWatchlistMovies

func PreviousWatchlistMovies() (movies []*Movies, err error)

PreviousWatchlistMovies ...

func SearchMovies

func SearchMovies(query string, page string) (movies []*Movies, err error)

SearchMovies ...

func TopMovies

func TopMovies(topCategory string, page string) (movies []*Movies, total int, err error)

TopMovies ...

func WatchlistMovies

func WatchlistMovies(isUpdateNeeded bool) (movies []*Movies, err error)

WatchlistMovies ...

type Object

type Object struct {
	Title     string    `json:"title"`
	Year      int       `json:"year"`
	IDs       *IDs      `json:"ids"`
	UpdatedAt time.Time `json:"updated_at"`
}

Object ...

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 ...

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 PausedShows

func PausedShows(isUpdateNeeded bool) ([]*PausedEpisode, error)

PausedShows ...

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 PausedMovies

func PausedMovies(isUpdateNeeded bool) ([]*PausedMovie, error)

PausedMovies ...

type ProgressShow

type ProgressShow struct {
	Episode *Episode `json:"episode"`
	Show    *Show    `json:"show"`
}

ProgressShow ...

func FilterHiddenProgressShows

func FilterHiddenProgressShows(inShows []*ProgressShow) (outShows []*ProgressShow)

FilterHiddenProgressShows returns a slice of ProgressShow without hidden shows

func WatchedShowsProgress

func WatchedShowsProgress() (shows []*ProgressShow, err error)

WatchedShowsProgress ...

type Season

type Season struct {
	// Show          *Show   `json:"-"`
	AiredEpisodes int     `json:"aired_episodes"`
	EpisodeCount  int     `json:"episode_count"`
	FirstAired    string  `json:"first_aired"`
	Network       string  `json:"network"`
	Number        int     `json:"number"`
	Overview      string  `json:"overview"`
	Rating        float32 `json:"rating"`
	Votes         int     `json:"votes"`

	Episodes []*Episode `json:"episodes"`
	IDs      *IDs       `json:"ids"`
}

Season ...

type Show

type Show struct {
	Object

	AiredEpisodes int      `json:"aired_episodes"`
	Airs          *Airs    `json:"airs"`
	Certification string   `json:"certification"`
	Country       string   `json:"country"`
	FirstAired    string   `json:"first_aired"`
	Genres        []string `json:"genres"`
	Language      string   `json:"language"`
	Network       string   `json:"network"`
	Overview      string   `json:"overview"`
	Rating        float32  `json:"rating"`
	Runtime       int      `json:"runtime"`
	TagLine       string   `json:"tagline"`
	Status        string   `json:"status"`
	Trailer       string   `json:"trailer"`
	Translations  []string `json:"available_translations"`
	URL           string   `json:"homepage"`
	Votes         int      `json:"votes"`
}

Show ...

func GetShow

func GetShow(ID string) (show *Show)

GetShow ...

func GetShowByTMDB

func GetShowByTMDB(tmdbID string) (show *Show)

GetShowByTMDB ...

func GetShowByTVDB

func GetShowByTVDB(tvdbID string) (show *Show)

GetShowByTVDB ...

func (*Show) ToListItem

func (show *Show) ToListItem() (item *xbmc.ListItem)

ToListItem ...

type ShowSearchResults

type ShowSearchResults []struct {
	Type  string      `json:"type"`
	Score interface{} `json:"score"`
	Show  *Show       `json:"show"`
}

ShowSearchResults ...

type Shows

type Shows struct {
	Watchers int   `json:"watchers"`
	Show     *Show `json:"show"`
}

Shows ...

func CollectionShows

func CollectionShows(isUpdateNeeded bool) (shows []*Shows, err error)

CollectionShows ...

func ListHiddenShows

func ListHiddenShows(section string, isUpdateNeeded bool) (shows []*Shows, err error)

ListHiddenShows updates list of hidden shows for a given section

func ListItemsShows

func ListItemsShows(user, listID string) (shows []*Shows, err error)

ListItemsShows ...

func PreviousCollectionShows

func PreviousCollectionShows() (shows []*Shows, err error)

PreviousCollectionShows ...

func PreviousListItemsShows

func PreviousListItemsShows(listID string) (shows []*Shows, err error)

PreviousListItemsShows ...

func PreviousWatchlistShows

func PreviousWatchlistShows() (shows []*Shows, err error)

PreviousWatchlistShows ...

func SearchShows

func SearchShows(query string, page string) (shows []*Shows, err error)

SearchShows ... TODO: Actually use this somewhere

func TopShows

func TopShows(topCategory string, page string) (shows []*Shows, total int, err error)

TopShows ...

func WatchlistShows

func WatchlistShows(isUpdateNeeded bool) (shows []*Shows, err error)

WatchlistShows ...

type Sizes

type Sizes struct {
	Full      string `json:"full"`
	Medium    string `json:"medium"`
	Thumbnail string `json:"thumb"`
}

Sizes ...

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 PollToken

func PollToken(code *Code) (token *Token, err error)

PollToken ...

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 ...

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 ...

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"`
		FavoritedAt   time.Time `json:"favorited_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"`
		FavoritedAt   time.Time `json:"favorited_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"`
		BlockedAt time.Time `json:"blocked_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"`
	Watchlist struct {
		UpdatedAt time.Time `json:"updated_at"`
	} `json:"watchlist"`
	Favorites struct {
		UpdatedAt time.Time `json:"updated_at"`
	} `json:"favorites"`
	Account struct {
		SettingsAt  time.Time `json:"settings_at"`
		FollowedAt  time.Time `json:"followed_at"`
		FollowingAt time.Time `json:"following_at"`
		PendingAt   time.Time `json:"pending_at"`
		RequestedAt time.Time `json:"requested_at"`
	} `json:"account"`
	SavedFilters struct {
		UpdatedAt time.Time `json:"updated_at"`
	} `json:"saved_filters"`
	Notes struct {
		UpdatedAt time.Time `json:"updated_at"`
	} `json:"notes"`
}

UserActivities is a structure, returned by sync/last_activities

func GetLastActivities

func GetLastActivities() (ret *UserActivities, err error)

GetLastActivities ...

type UserSettings

type UserSettings struct {
	User    User     `json:"user"`
	Account struct{} `json:"account"`
}

UserSettings ...

type WatchedEpisode

type WatchedEpisode struct {
	Number        int       `json:"number"`
	Plays         int       `json:"plays"`
	LastWatchedAt time.Time `json:"last_watched_at"`
}

WatchedEpisode ...

type WatchedItem

type WatchedItem struct {
	MediaType string
	KodiID    int
	KodiKey   uint64
	Movie     int
	Show      int
	Season    int
	Episode   int
	Watched   bool
	WatchedAt time.Time
}

WatchedItem represents possible watched add/delete item

func (*WatchedItem) String

func (item *WatchedItem) String() (query string)

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, checkDate bool) []*WatchedMovie

DiffWatchedMovies ...

func PreviousWatchedMovies

func PreviousWatchedMovies() (movies []*WatchedMovie, err error)

PreviousWatchedMovies ...

type WatchedMoviesType

type WatchedMoviesType []*WatchedMovie

func WatchedMovies

func WatchedMovies(isUpdateNeeded bool) (WatchedMoviesType, error)

WatchedMovies ...

func (WatchedMoviesType) ToMovies

func (m WatchedMoviesType) ToMovies() []*Movies

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 ...

type WatchedSeason

type WatchedSeason struct {
	Plays    int               `json:"plays"`
	Number   int               `json:"number"`
	Episodes []*WatchedEpisode `json:"episodes"`
}

WatchedSeason ...

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 ...

type WatchedShowsType

type WatchedShowsType []*WatchedShow

func WatchedShows

func WatchedShows(isUpdateNeeded bool) (WatchedShowsType, error)

WatchedShows ...

func (WatchedShowsType) ToShows

func (s WatchedShowsType) ToShows() []*Shows

type Watchlist

type Watchlist struct {
	Movies   []*Movie   `json:"movies"`
	Shows    []*Show    `json:"shows"`
	Episodes []*Episode `json:"episodes"`
}

Watchlist ...

type WatchlistEpisode

type WatchlistEpisode struct {
	ListedAt time.Time `json:"listed_at"`
	Type     string    `json:"type"`
	Episode  *Episode  `json:"episode"`
	Show     *Object   `json:"show"`
}

WatchlistEpisode ...

type WatchlistMovie

type WatchlistMovie struct {
	ListedAt time.Time `json:"listed_at"`
	Type     string    `json:"type"`
	Movie    *Movie    `json:"movie"`
}

WatchlistMovie ...

type WatchlistSeason

type WatchlistSeason struct {
	ListedAt time.Time `json:"listed_at"`
	Type     string    `json:"type"`
	Season   *Object   `json:"season"`
	Show     *Object   `json:"show"`
}

WatchlistSeason ...

type WatchlistShow

type WatchlistShow struct {
	ListedAt time.Time `json:"listed_at"`
	Type     string    `json:"type"`
	Show     *Show     `json:"show"`
}

WatchlistShow ...

Jump to

Keyboard shortcuts

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