episodeorder

package
v0.2.25 Latest Latest
Warning

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

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

Documentation

Overview

Package episodeorder provides presentation-only TV ordering. Canonical TMDB keys and season/episode identity never change, including during playback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Preference

type Preference struct {
	GroupID   string `json:"groupId"`
	Specials  string `json:"specials"` // first, last, hidden; included group specials retain their chosen position
	Inherited bool   `json:"inherited,omitempty"`
}

type Service

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

func New

func New(db *sql.DB, source Source, catalog core.Catalog) *Service

func (*Service) Children

func (s *Service) Children(ctx context.Context, u *core.User, k core.RatingKey) ([]core.Title, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, u *core.User, k core.RatingKey) (*core.Title, error)

func (*Service) Grandchildren

func (s *Service) Grandchildren(ctx context.Context, u *core.User, k core.RatingKey) ([]core.Title, error)

func (*Service) Grouped added in v0.2.4

func (s *Service) Grouped(ctx context.Context, u *core.User, shows []core.RatingKey) (map[core.RatingKey]bool, error)

Grouped reports which of the shows present an alternate episode group to the viewer: their own preference, else the owner's default. A show without one keeps the canonical season tree, so a list can render it from the catalogue without loading its layout title by title.

func (*Service) Position

func (s *Service) Position(ctx context.Context, u *core.User, k core.RatingKey) (season, episode int, name string, ok bool)

Position returns only presentation fields, leaving the catalogue title intact.

func (*Service) Preference

func (s *Service) Preference(ctx context.Context, user int64, show core.RatingKey) (Preference, error)

func (*Service) Reset

func (s *Service) Reset(ctx context.Context, user int64, show core.RatingKey) error

func (*Service) Router

func (s *Service) Router() http.Handler

Router is mounted behind owner authentication. Viewer zero is the owner default; a positive viewer is an explicit override, including aired order.

func (*Service) Save

func (s *Service) Save(ctx context.Context, user int64, show core.RatingKey, p Preference) error

func (*Service) SetBus

func (s *Service) SetBus(bus clusterbus.Bus)

SetBus connects the cluster bus (nil disconnects): preference changes on any node drop every node's cached episode layouts.

type Source

type Source interface {
	EpisodeGroups(context.Context, int64) ([]tmdb.EpisodeGroupSummary, error)
	EpisodeGroup(context.Context, string) (*tmdb.EpisodeGroup, error)
}

Jump to

Keyboard shortcuts

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