Documentation
¶
Overview ¶
Package simkl implements tracker.Provider for Simkl (https://api.simkl.org/).
Simkl suspends client ids that poll their library endpoints, so the library is pulled in full once and then only as deltas (date_from) when /sync/activities moved. See library.go.
Index ¶
- type Provider
- func (p *Provider) Add(loc tracker.Location, listID string, items []*tracker.Item) error
- func (p *Provider) Authorize() error
- func (p *Provider) Authorized() bool
- func (p *Provider) Collection(t tracker.MediaType, refresh bool) ([]*tracker.Item, error)
- func (p *Provider) Deauthorize() error
- func (p *Provider) ID() string
- func (p *Provider) LastActivities() (*tracker.Activities, error)
- func (p *Provider) ListItems(listID string, t tracker.MediaType, refresh bool) ([]*tracker.Item, error)
- func (p *Provider) Lists() ([]*tracker.List, error)
- func (p *Provider) MinSyncInterval() time.Duration
- func (p *Provider) Name() string
- func (p *Provider) Paused(t tracker.MediaType, refresh bool) ([]*tracker.PausedItem, error)
- func (p *Provider) Progress(refresh bool) ([]*tracker.Item, error)
- func (p *Provider) RefreshToken() error
- func (p *Provider) Remove(loc tracker.Location, listID string, items []*tracker.Item) error
- func (p *Provider) Scrobble(action tracker.ScrobbleAction, item *tracker.Item, progress float64) error
- func (p *Provider) SetWatched(items []*tracker.WatchedItem, watched bool) error
- func (p *Provider) Watched(t tracker.MediaType, refresh bool) ([]*tracker.WatchedItem, error)
- func (p *Provider) Watchlist(t tracker.MediaType, refresh bool) ([]*tracker.Item, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the Simkl tracker.
func (*Provider) Add ¶
Add supports the watchlist, and the collection through it: a title added to Plan to Watch is in the library. Custom lists are edited on simkl.com.
func (*Provider) Authorized ¶
func (*Provider) Collection ¶ added in v0.1.118
Collection is the whole library in every status, like simkl.com "My Movies" and "My TV Shows".
func (*Provider) Deauthorize ¶
func (*Provider) LastActivities ¶
func (p *Provider) LastActivities() (*tracker.Activities, error)
LastActivities reads activities and keeps them as the base for library deltas of this sync.
func (*Provider) Lists ¶
Lists returns the library status lists, then custom lists. Custom lists are a Simkl PRO and VIP feature, other accounts get only the status lists.
func (*Provider) MinSyncInterval ¶
func (*Provider) Progress ¶ added in v0.1.117
Progress returns the next episode of every show in Watching, most recently watched first. Shows without a next episode are caught up and left out, as Simkl recommends.
func (*Provider) RefreshToken ¶
RefreshToken renews the 7-day token a day before expiry.
func (*Provider) Remove ¶
Remove supports only the watchlist. Simkl removes items through /sync/history/remove, which also wipes watch history, so only items that are in plantowatch (and therefore have no history) are removed.
func (*Provider) SetWatched ¶
func (p *Provider) SetWatched(items []*tracker.WatchedItem, watched bool) error
SetWatched adds or removes watch history. Unwatching a whole movie or show removes it from the Simkl library, as Simkl has no other way to clear a watch.