Documentation
¶
Overview ¶
Package ratings caches licensed, owner-keyed rating data. Values preserve their source scale; Plex's main rating fields alone use the 0–10 scale.
Index ¶
- Constants
- type Badge
- type Options
- type Service
- func (s *Service) Cached(ctx context.Context, t *core.Title) ([]Badge, error)
- func (s *Service) MigrateSecrets(ctx context.Context) (int, error)
- func (s *Service) Prune(ctx context.Context) (int64, error)
- func (s *Service) Queue(t core.Title)
- func (s *Service) Refresh(ctx context.Context, t *core.Title) ([]Badge, error)
- func (s *Service) Router(cat core.Catalog) http.Handler
- func (s *Service) Run(ctx context.Context)
- func (s *Service) SaveSettings(ctx context.Context, v Settings) error
- func (s *Service) Settings(ctx context.Context) (Settings, error)
- type Settings
Constants ¶
View Source
const Redacted = "[configured]"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Badge ¶
type Badge struct {
Source string `json:"source"`
Value float64 `json:"value"`
Scale float64 `json:"scale"`
Votes int64 `json:"votes,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) MigrateSecrets ¶ added in v0.2.4
MigrateSecrets seals an API key stored in plaintext; it returns 1 when it rewrote the settings. The row is replaced only if unchanged since read, and a key that does not open is left untouched.
func (*Service) Prune ¶
Prune deletes rating rows older than the maximum cache interval. It is meant to be called periodically.
func (*Service) Queue ¶
Queue is bounded, deduplicated and nonblocking; Run owns the network worker.
func (*Service) SaveSettings ¶
Click to show internal directories.
Click to hide internal directories.