trakt

package
v0.0.0-...-b267672 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package trakt implements the Trakt.tv API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	DataPath        string
	ClientID        string
	ClientSecret    string
	IsAuthenticated bool
	// contains filtered or unexported fields
}

API represents the Trakt API

func (*API) Authenticate

func (api *API) Authenticate() error

Authenticate against the Trakt API

type Episode

type Episode struct {
	Number      int       `json:"number"`
	LastWatched time.Time `json:"last_watched_at"`
}

Episode represents an episode that was reported as watched on Trakt

func (*Episode) LastWatchedBefore

func (e *Episode) LastWatchedBefore(t time.Time) bool

LastWatchedBefore returns when an episode was reported as last watched on Trakt

type Season

type Season struct {
	Number   int       `json:"number"`
	Episodes []Episode `json:"episodes"`
}

Season represents a season that was reported as (partially) watched on Trakt

func (*Season) FindEpisode

func (s *Season) FindEpisode(episodeNumber int) *Episode

FindEpisode tries to find if a (partially) watched season on Trakt contains an episode with a specified number

type User

type User struct {
	Name         string
	WatchedShows []WatchedShow
}

User represents the Trakt User

func (*User) FindWatchedShowByIMDBID

func (user *User) FindWatchedShowByIMDBID(imdbid string) *WatchedShow

FindWatchedShowByTVDBID returns a watched show for this user by IMDb id

func (*User) FindWatchedShowByName

func (user *User) FindWatchedShowByName(name string) *WatchedShow

FindWatchedShowByName returns a watched show for this user by name

func (*User) FindWatchedShowByTVDBID

func (user *User) FindWatchedShowByTVDBID(tvdbid int) *WatchedShow

FindWatchedShowByTVDBID returns a watched show for this user by TVDB id

func (*User) GetWatchedShows

func (user *User) GetWatchedShows(api API) error

GetWatchedShows returns the watched shows for this user

type WatchedShow

type WatchedShow struct {
	Show    show     `json:"show"`
	Seasons []Season `json:"seasons"`
}

WatchedShow represents a show that reported watched on Trakt

func (*WatchedShow) FindSeason

func (w *WatchedShow) FindSeason(seasonNumber int) *Season

FindSeason tries to find if a watched show on Trakt contains a season with a specified number

Jump to

Keyboard shortcuts

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