scrob

package
v0.1.119 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 14 Imported by: 0

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

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 NewProvider

func NewProvider() *Provider

NewProvider returns the Scrob tracker.

func (*Provider) Add

func (p *Provider) Add(loc tracker.Location, listID string, items []*tracker.Item) error

func (*Provider) Authorize

func (p *Provider) Authorize() error

func (*Provider) Authorized

func (p *Provider) Authorized() bool

Authorized is true with a server address and either an API key or a device token.

func (*Provider) Collection

func (p *Provider) Collection(t tracker.MediaType, refresh bool) ([]*tracker.Item, error)

Collection reads collected movies, or the shows of collected series and episodes.

func (*Provider) Deauthorize

func (p *Provider) Deauthorize() error

func (*Provider) ID

func (p *Provider) ID() string

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

func (p *Provider) Lists() ([]*tracker.List, error)

Lists returns user lists except the one standing in for the watchlist.

func (*Provider) MinSyncInterval

func (p *Provider) MinSyncInterval() time.Duration

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Paused

func (p *Provider) Paused(t tracker.MediaType, refresh bool) ([]*tracker.PausedItem, error)

Paused reads Continue Watching.

func (*Provider) Progress

func (p *Provider) Progress(refresh bool) ([]*tracker.Item, error)

Progress reads Next Up: the next episode of every show in progress.

func (*Provider) RefreshToken

func (p *Provider) RefreshToken() error

RefreshToken renews the 24-hour device token two hours before expiry. API keys do not expire.

func (*Provider) Remove

func (p *Provider) Remove(loc tracker.Location, listID string, items []*tracker.Item) error

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.

func (*Provider) Watched

func (p *Provider) Watched(t tracker.MediaType, refresh bool) ([]*tracker.WatchedItem, error)

Watched reads the whole watch history, newest first.

func (*Provider) Watchlist

func (p *Provider) Watchlist(t tracker.MediaType, refresh bool) ([]*tracker.Item, error)

Jump to

Keyboard shortcuts

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