entities

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraktItemTypeEpisode = "episode"
	TraktItemTypeMovie   = "movie"
	TraktItemTypeSeason  = "season"
	TraktItemTypeShow    = "show"
	TraktItemTypePerson  = "person"
)

Variables

This section is empty.

Functions

func InferTraktListSlug

func InferTraktListSlug(imdbListName string) string

Types

type Diff added in v1.3.1

type Diff struct {
	Add    []TraktItem
	Remove []TraktItem
}

func ItemsDifference

func ItemsDifference(imdbItems map[string]IMDbItem, traktItems map[string]TraktItem) Diff

func ListDiff added in v1.3.1

func ListDiff(imdbList IMDbList, traktList TraktList) Diff

func (*Diff) Sort added in v1.3.1

func (d *Diff) Sort()

type IMDbItem

type IMDbItem struct {
	ID      string
	Kind    string
	Created time.Time
	Rating  *int
}

type IMDbList

type IMDbList struct {
	ListID      string
	ListName    string
	ListItems   []IMDbItem
	IsWatchlist bool
}

type TraktAuthCodesBody

type TraktAuthCodesBody struct {
	ClientID string `json:"client_id"`
}

type TraktAuthCodesResponse

type TraktAuthCodesResponse struct {
	DeviceCode string `json:"device_code"`
	UserCode   string `json:"user_code"`
}

type TraktAuthTokensBody

type TraktAuthTokensBody struct {
	Code         string `json:"code"`
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type TraktAuthTokensResponse

type TraktAuthTokensResponse struct {
	AccessToken string `json:"access_token"`
}

type TraktCrudItem

type TraktCrudItem struct {
	Movies   int `json:"movies,omitempty"`
	Shows    int `json:"shows,omitempty"`
	Episodes int `json:"episodes,omitempty"`
	People   int `json:"people,omitempty"`
}

type TraktIDMeta

type TraktIDMeta struct {
	IMDb     string  `json:"imdb,omitempty"`
	Slug     string  `json:"slug,omitempty"`
	ListName *string `json:"-"`
}

type TraktIDMetas

type TraktIDMetas []TraktIDMeta

func (TraktIDMetas) GetListNameFromSlug

func (tidm TraktIDMetas) GetListNameFromSlug(slug string) string

type TraktItem

type TraktItem struct {
	Type    string        `json:"type"`
	RatedAt string        `json:"rated_at,omitempty"`
	Rating  int           `json:"rating,omitempty"`
	Movie   TraktItemSpec `json:"movie,omitempty"`
	Show    TraktItemSpec `json:"show,omitempty"`
	Episode TraktItemSpec `json:"episode,omitempty"`
	Person  TraktItemSpec `json:"person,omitempty"`
	// contains filtered or unexported fields
}

func (*TraktItem) GetItemID

func (item *TraktItem) GetItemID() (*string, error)

type TraktItemSpec

type TraktItemSpec struct {
	IDMeta    TraktIDMeta `json:"ids"`
	RatedAt   *string     `json:"rated_at,omitempty"`
	Rating    *int        `json:"rating,omitempty"`
	WatchedAt *string     `json:"watched_at,omitempty"`
}

type TraktItemSpecs

type TraktItemSpecs []TraktItemSpec

type TraktItems

type TraktItems []TraktItem

type TraktList

type TraktList struct {
	Name        *string     `json:"name,omitempty"`
	IDMeta      TraktIDMeta `json:"ids"`
	ListItems   TraktItems
	IsWatchlist bool
}

type TraktListAddBody

type TraktListAddBody 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"`
}

type TraktListBody

type TraktListBody struct {
	Movies   TraktItemSpecs `json:"movies,omitempty"`
	Shows    TraktItemSpecs `json:"shows,omitempty"`
	Episodes TraktItemSpecs `json:"episodes,omitempty"`
	People   TraktItemSpecs `json:"people,omitempty"`
}

type TraktResponse

type TraktResponse struct {
	Added    *TraktCrudItem `json:"added,omitempty"`
	Deleted  *TraktCrudItem `json:"deleted,omitempty"`
	Existing *TraktCrudItem `json:"existing,omitempty"`
	NotFound *TraktListBody `json:"not_found,omitempty"`
}

type TraktUserInfo added in v1.1.2

type TraktUserInfo struct {
	Username string      `json:"username"`
	Private  bool        `json:"private"`
	Name     string      `json:"name"`
	Vip      bool        `json:"vip"`
	VipEp    bool        `json:"vip_ep"`
	IDMeta   TraktIDMeta `json:"ids"`
}

Jump to

Keyboard shortcuts

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