overlays

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package overlays creates truthful, versioned poster variants in pure Go. Quality badges require observed release facts; metadata estimates are never treated as evidence of 4K/HDR/Dolby Vision/Atmos availability.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artwork

type Artwork struct {
	Posters        []Variant `json:"posters"`
	Backdrops      []Variant `json:"backdrops"`
	PinnedPoster   string    `json:"pinnedPoster,omitempty"`
	PinnedBackdrop string    `json:"pinnedBackdrop,omitempty"`
}

type Facts

type Facts struct {
	NewEpisode  bool
	NewSeason   bool
	Returning   bool
	LastChance  time.Time
	Height      int
	HDR         bool
	DolbyVision bool
	Atmos       bool
}

type ImageSource

type ImageSource interface {
	Get(context.Context, string, int) ([]byte, string, error)
}

type Options

type Options struct {
	Images   ImageSource
	Allowed  func(*core.User, *core.Title) bool
	Facts    func(context.Context, *core.User, *core.Title) Facts
	Ratings  *ratings.Service
	Taste    func(context.Context, *core.User) []string
	Now      func() time.Time
	Variants func(context.Context, *core.Title, string) (Artwork, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB, o Options) *Service

func (*Service) Artwork

func (s *Service) Artwork(ctx context.Context, key core.RatingKey) (Artwork, error)

func (*Service) Backdrop

func (s *Service) Backdrop(ctx context.Context, u *core.User, t *core.Title, lang string) ([]byte, string, error)

func (*Service) Labels

func (s *Service) Labels(ctx context.Context, u *core.User, t *core.Title) []string
func (s *Service) Logo(ctx context.Context, t *core.Title) ([]byte, string, error)

func (*Service) Paths

func (s *Service) Paths(ctx context.Context, u *core.User, t *core.Title, lang string) (string, string)

Paths returns owner-approved variants, selected by language and actual tags.

func (*Service) Poster

func (s *Service) Poster(ctx context.Context, u *core.User, t *core.Title, lang string) ([]byte, string, error)

Poster decodes bounded images and uses a bounded generated-image cache.

func (*Service) Router

func (s *Service) Router(cat core.Catalog, users func(*http.Request, int64) (*core.User, error)) http.Handler

Router must be owner authenticated. Previews pass through the same generator as Plex; the caller supplies real catalog titles, never arbitrary image URLs.

func (*Service) SaveArtwork

func (s *Service) SaveArtwork(ctx context.Context, key core.RatingKey, v Artwork) error

func (*Service) SaveSettings

func (s *Service) SaveSettings(ctx context.Context, v Settings) error

func (*Service) Settings

func (s *Service) Settings(ctx context.Context) (Settings, error)

func (*Service) Version

func (s *Service) Version(ctx context.Context, u *core.User, t *core.Title, lang string) string

type Settings

type Settings struct {
	Enabled     bool `json:"enabled"`
	Status      bool `json:"status"`
	Quality     bool `json:"quality"`
	Ratings     bool `json:"ratings"`
	Personalize bool `json:"personalize"`
	Localize    bool `json:"localize"`
}

type Variant

type Variant struct {
	Path     string   `json:"path"`
	Language string   `json:"language,omitempty"`
	Tags     []string `json:"tags,omitempty"`
}

Jump to

Keyboard shortcuts

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