Documentation
¶
Overview ¶
Package scrob implements tracker.Provider for a self-hosted Scrob server (https://github.com/ellite/scrob).
Scrob reports no activity timestamps, so every sync reads everything again. It has no watchlist, so a user list named "Watchlist" stands in for it. Its collection is read-only here: Scrob accepts collection writes only from its own web session, not from device tokens or API keys.
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) (err 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{}
Provider is the Scrob tracker.
func (*Provider) Authorized ¶
Authorized is true with a server address and either an API key or a device token.
func (*Provider) Collection ¶
Collection reads collected movies, or the shows of collected series and episodes.
func (*Provider) Deauthorize ¶
func (*Provider) LastActivities ¶
func (p *Provider) LastActivities() (*tracker.Activities, error)
LastActivities has nothing to report: absent buckets make every sync read everything.
func (*Provider) ListItems ¶
func (p *Provider) ListItems(listID string, t tracker.MediaType, refresh bool) ([]*tracker.Item, error)
ListItems returns the movies, or the shows, of a list. Season and episode entries are skipped.
func (*Provider) MinSyncInterval ¶
func (*Provider) RefreshToken ¶
RefreshToken renews the 24-hour device token two hours before expiry. API keys do not expire.
func (*Provider) Scrobble ¶
func (p *Provider) Scrobble(action tracker.ScrobbleAction, item *tracker.Item, progress float64) error
Scrobble drives a Scrob playback session. Starting a session for the same item replaces the previous one, so every event starts it again and then sets progress. Stop is sent only for watched items, so it completes.
func (*Provider) SetWatched ¶
func (p *Provider) SetWatched(items []*tracker.WatchedItem, watched bool) (err error)
SetWatched adds or removes plays one item at a time, as Scrob has no bulk history endpoint.