cutscenes

package
v0.0.0-...-95891f2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cutscenes keeps a campaign's cut scenes: short full-screen moments the Director pushes onto chosen players' screens, in Chronicle and in Foundry. A scene is three separate layers (the background, what is drawn on top, the words) and an ending; one play of it to named people is a showing, which keeps a copy of the scene as shown so the people it was for can watch it again for a while even after the scene changes or is deleted.

The scene is data, never markup: every kind, colour and number is checked and clamped here before it is stored, and the browser engine draws words with textContent. Showing is a live act of the Director's; the AI may write scenes through review but can never show one.

The HTTP surface for cut scenes. Handlers bind, call the service and render; the service owns every rule, so a mis-wired route cannot widen access.

Hand-written SQL for cut scenes and their showings.

SECURITY: every statement filters on campaign_id (directly, or through the showing for its viewers), so an id from another campaign never reads or changes anything here.

Route registration for cut scenes.

Index

Constants

View Source
const (
	BackgroundFallAsleep  = "fall-asleep"
	BackgroundBlack       = "black"
	BackgroundFadeToBlack = "fade-to-black"
	BackgroundNone        = "none"

	OverlayEye    = "eye"
	OverlayEmbers = "embers"

	StyleWhisper = "whisper"
	StyleTitle   = "title"
	StylePlain   = "plain"

	EndingTap  = "tap"
	EndingAuto = "auto"
)

The kinds a scene may use. The browser engine (static/js/cutscene_engine.js) draws each of these; a Go test greps the engine for every one so the two lists cannot drift apart. The engine draws nothing for a kind it does not know, so an older client never breaks on a newer scene.

View Source
const (
	PupilRound = "round"
	PupilSlit  = "slit"
)

Pupils an eye can be drawn with, whatever its look. Ids and names mirror the engine's ChronicleCutscene.pupils table, in its order; a Go test reads the engine to keep them equal. A layer naming none gets its look's own.

View Source
const (
	MaxNameChars   = 120
	MaxOverlays    = 8
	MaxTextLines   = 12
	MaxSayChars    = 280
	MinSeconds     = 0.5
	MaxSeconds     = 60.0
	MaxAt          = 120.0
	MaxAfter       = 60.0
	DefaultAfter   = 3.0
	DefaultSeconds = 5.0
	// MaxBodyBytes caps a scene sent as JSON or a form; a full scene is a few
	// kilobytes.
	MaxBodyBytes = 64 << 10
)

Limits on a scene. Numbers outside them are clamped, never refused; counts and text lengths over them are refused with a plain sentence.

View Source
const (
	DefaultEyeColor    = "#3dff7a"
	DefaultEmbersColor = "#ff9a3c"
)

Default colours, used when a layer comes without one.

View Source
const AddonSlug = "cutscenes"

AddonSlug is the campaign switch for cut scenes. It is off until a campaign turns it on.

View Source
const DefaultRewatch = "12h"

DefaultRewatch is the Show sheet's preselected window.

View Source
const EngineSrc = "/static/js/cutscene_engine.js"

EngineSrc is where the cut scene engine is loaded from; the workshop script loads it the first time Preview is pressed.

View Source
const KindName = "cut-scene"

KindName is the block's front-matter kind.

View Source
const LiveFor = 5 * time.Minute

LiveFor is how long after it starts a showing that was not stopped still counts as playing: longer than the longest scene the limits allow.

View Source
const MaxViewers = 100

MaxViewers caps how many people one showing names.

View Source
const PluginSlug = "cutscenes"

PluginSlug names this plugin in the registry and the health/migration bookkeeping, so a failed migration leaves only cut scenes out.

Variables

View Source
var (
	BackgroundKinds = []Kind{
		{BackgroundFallAsleep, "Falling asleep", "darkness creeps in from the edges in soft, blurred patches until the screen is black, like eyes closing"},
		{BackgroundFadeToBlack, "Fade to black", "the whole screen dims evenly to black"},
		{BackgroundBlack, "Black", "the screen is black at once"},
		{BackgroundNone, "Nothing", "no background of its own; only the layers on top and the words are drawn"},
	}
	OverlayKinds = []Kind{
		{OverlayEye, "An eye opens", "a single eye opens in the middle of the screen, burning with light in its colour, with fire blooming round it"},
		{OverlayEmbers, "Embers", "glowing sparks drift up from the bottom of the screen in its colour"},
	}
	TextStyles = []Kind{
		{StyleWhisper, "Whisper", "small, spaced italic letters that fade in softly"},
		{StyleTitle, "Title", "large display letters, like a chapter heading"},
		{StylePlain, "Plain", "ordinary reading text"},
	}
	EndingKinds = []Kind{
		{EndingTap, "When they tap", "a quiet Close appears once the last layer has finished; a tap, click or Esc closes it"},
		{EndingAuto, "By itself", "it closes on its own a few seconds after the last layer has finished"},
	}
)

BackgroundKinds, OverlayKinds and TextStyles are every choice in the order the editor offers them; the first background and style are the defaults.

View Source
var Looks = map[string][]Look{
	BackgroundFallAsleep: {
		{"ink", "Ink in water", "darkness bleeds in from the edges like ink spreading through water, in curling soft tendrils that meet in the middle", ""},
		{"eyelids", "Heavy eyelids", "soft dark patches breathe in from the edges while eyelids droop and flutter open twice before they give in", ""},
		{"drift", "The page drifts off", "the screen itself blurs, loses its colour and sinks while darkness closes in like tunnel vision and soft dark spots float across it", ""},
	},
	OverlayEye: {
		{"rift", "Burning seam", "a line of fire burns across the dark and tears open into a ragged eye with a round pupil that narrows onto you; as it opens, fire blooms around it in the eye's colour and a haze of heat veils the eye", PupilRound},
		{"almond", "Lids part", "a thin seam of light cracks, hesitates, then the lids part on a burning iris with a slit pupil; as they open, fire blooms around the eye and a haze of heat veils it", PupilSlit},
		{"gather", "Sparks gather", "sparks drift out of the dark into a ring of fire; lines of light draw the eye around it, the pupil splits open and fire blooms around it under a haze of heat", PupilSlit},
	},
}

Looks lists the looks of each kind that has them. A look on any other kind, or one not listed here, is dropped, and the engine plays the default.

View Source
var MigrationsFS embed.FS

MigrationsFS contains the embedded SQL migration files so the tables are created from the compiled binary regardless of the working directory.

View Source
var Pupils = []Kind{
	{PupilRound, "Round", "a round black pupil that widens and narrows"},
	{PupilSlit, "Dragon slit", "a tall reptilian slit that narrows and flares with the fire, in a scaled, veined iris"},
}
View Source
var RewatchChoices = []struct {
	Key   string
	Name  string
	Hours int
}{
	{"1h", "1 hour", 1},
	{"12h", "Tonight (12 hours)", 12},
	{"72h", "3 days", 72},
}

Rewatch windows the Show sheet offers, by their form value.

View Source
var StaticAssetsFS embed.FS

StaticAssetsFS holds the Director's workshop script and stylesheet, served at /static/plugins/cutscenes/.

Functions

func Ago

func Ago(t, now time.Time) string

Ago says how long ago a time was, roughly.

func BackgroundWords

func BackgroundWords(b Background) string

BackgroundWords says the background: "falling asleep over 7 s".

func ColorName

func ColorName(hex string) string

ColorName names a #rrggbb colour in a plain word ("green", "deep red"), for review lines; "" for an empty or malformed colour.

func EndingWords

func EndingWords(e Ending) string

EndingWords says how the scene closes.

func LookKey

func LookKey(kind, key string) string

LookKey is the look the editor's picker shows selected: the layer's own, or the default when it has none.

func LookWords

func LookWords(kind, key string) string

LookWords names a layer's look for a kind that has several, saying when it is the default because none was picked: `, look "Heavy eyelids"`. It is empty for a kind with one way of being drawn.

func OverlayWords

func OverlayWords(o Overlay) string

OverlayWords says one layer on top: "green eye at 7.5 s".

func PupilKey

func PupilKey(key string) string

PupilKey is the pupil the editor's picker shows selected: the layer's own, or "" (the look's own) when it names none or an unknown one.

func PupilWords

func PupilWords(o Overlay) string

PupilWords names an eye's pupil, saying when it is the look's own because none was picked: `, pupil "Dragon slit"`. It is empty for anything but an eye.

func RegisterRoutes

func RegisterRoutes(e *echo.Echo, h *Handler, campaignSvc campaigns.CampaignService, authSvc auth.AuthService, addonSvc addons.AddonService)

RegisterRoutes mounts the routes under the campaign group. Every route needs a signed-in member of at least Player role and the Cut scenes add-on on. The Director routes then turn anyone who is not the owner or a co-DM away with a 404 (the co-DM grant cannot be expressed by a role middleware), and the service decides again; a showing is readable only by the people it was for. CSRF is enforced by the global middleware.

func SceneBlock

func SceneBlock(s Scene) string

SceneBlock is the scene's front matter in the cut-scene block's format.

func SceneWords

func SceneWords(s Scene) string

SceneWords is the one-line summary under a scene's name on the list page.

func Secs

func Secs(v float64) string

Secs says a number of seconds: "7 s", "7.5 s".

func TextWords

func TextWords(t TextLine) string

TextWords says one line of words: "'Something has noticed you.' at 11 s".

func Until

func Until(end, now time.Time) string

Until says how long is left of a window, roughly: "12 hours", "3 days", "40 minutes"; "" once it has passed.

Types

type AI

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

AI is the cut scenes' part of the AI engine (aiplug, ADR-071): the `cut-scene` block an AI can ask to write and the `cut-scenes` lookup. Every read and write goes through Service, so the Director-only rule and the one check of a scene (Normalize) are the service's own; this file words them for the review screen. Showing a scene is never something the AI can ask for: it is a live act of the Director's, on the Cut scenes page.

func NewAI

func NewAI(svc Service, on func(ctx context.Context, campaignID string) bool) *AI

NewAI builds the AI part. on reports whether the campaign has the Cut scenes add-on switched on: the service does not ask, because its routes are gated where they are mounted.

func (*AI) Kinds

func (a *AI) Kinds() []aiplug.Kind

Kinds is the one block kind.

func (*AI) Lookup

func (a *AI) Lookup() aiplug.Lookup

Lookup is the `cut-scenes` lookup, also a tool on a connected AI app.

type AudienceRow

type AudienceRow struct {
	Member
	Place Place
	You   bool
}

AudienceRow is one person on the Show sheet.

type Background

type Background struct {
	Kind    string  `json:"kind"`
	Seconds float64 `json:"seconds"`
	Params  Params  `json:"params"`
}

Background is the bottom layer: how the screen goes dark.

type Ending

type Ending struct {
	Kind  string   `json:"kind"`
	After *float64 `json:"after,omitempty"`
}

Ending says how the scene closes. After (auto only) is seconds after the last layer has finished.

type Handler

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

Handler serves the cut scene routes.

func NewHandler

func NewHandler(svc Service) *Handler

NewHandler builds the handler.

func (*Handler) Create

func (h *Handler) Create(c *echo.Context) error

Create handles POST /campaigns/:id/cutscenes.

func (*Handler) Delete

func (h *Handler) Delete(c *echo.Context) error

Delete handles POST /campaigns/:id/cutscenes/:sid/delete. Showings keep their copy of the scene, so people can still watch it again.

func (*Handler) Editor

func (h *Handler) Editor(c *echo.Context) error

Editor handles GET /campaigns/:id/cutscenes/:sid.

func (*Handler) List

func (h *Handler) List(c *echo.Context) error

List handles GET /campaigns/:id/cutscenes, the Cut scenes page.

func (*Handler) Mine

func (h *Handler) Mine(c *echo.Context) error

Mine handles GET /campaigns/:id/cutscenes/mine: the caller's showings still inside their window, newest first.

func (*Handler) New

func (h *Handler) New(c *echo.Context) error

New handles GET /campaigns/:id/cutscenes/new.

func (*Handler) Preview

func (h *Handler) Preview(c *echo.Context) error

Preview handles POST /campaigns/:id/cutscenes/preview: the editor's form as the scene JSON the engine plays, checked exactly as a save would be, so Preview shows unsaved changes and never something a save would refuse.

func (*Handler) ReadShowing

func (h *Handler) ReadShowing(c *echo.Context) error

ReadShowing handles GET /campaigns/:id/cutscenes/showings/:shid.

func (*Handler) Save

func (h *Handler) Save(c *echo.Context) error

Save handles POST /campaigns/:id/cutscenes/:sid. The editor posts the whole scene; an HTMX save answers with the form redrawn as stored.

func (*Handler) Show

func (h *Handler) Show(c *echo.Context) error

Show handles POST /campaigns/:id/cutscenes/:sid/show. It answers with the live row; a refusal redraws the sheet with the reason in it.

func (*Handler) ShowSheet

func (h *Handler) ShowSheet(c *echo.Context) error

ShowSheet handles GET /campaigns/:id/cutscenes/:sid/show, the "Show to…" sheet (an HTMX fragment).

func (*Handler) Showings

func (h *Handler) Showings(c *echo.Context) error

Showings handles GET /campaigns/:id/cutscenes/showings, the Director's recent showings: a fragment for HTMX, JSON otherwise.

func (*Handler) Stop

func (h *Handler) Stop(c *echo.Context) error

Stop handles POST /campaigns/:id/cutscenes/showings/:shid/stop.

func (*Handler) Watched

func (h *Handler) Watched(c *echo.Context) error

Watched handles POST /campaigns/:id/cutscenes/showings/:shid/watched.

type Kind

type Kind struct {
	Key   string
	Name  string // what the editor's picker says
	Looks string // what it looks like on screen, for the AI and the editor's hint
}

Kind is one choice a layer offers, with the plain words the editor and the AI use for it.

type Look

type Look struct {
	Key   string
	Name  string
	Looks string
	Pupil string // an eye look's own pupil, drawn when the layer names none
}

Look is one way a kind can be drawn. The ids and names mirror the engine's ChronicleCutscene.looks table, in its order, the first being the one the engine plays when a scene names none; a Go test reads the engine to keep them equal.

type Member

type Member struct {
	UserID   string
	Name     string
	Director bool // the owner or a co-DM
}

Member is one person in the campaign, from the member list.

type MemberShowing

type MemberShowing struct {
	ShowingID    string    `json:"showingId"`
	Name         string    `json:"name"`
	ShownAt      time.Time `json:"shownAt"`
	RewatchUntil time.Time `json:"rewatchUntil"`
	Scene        Scene     `json:"scene"`
}

MemberShowing is one showing as the sync API hands it to the Foundry GM client, with the scene to play.

type Members

type Members interface {
	Members(ctx context.Context, campaignID string) ([]Member, error)
}

Members lists the campaign's people; implemented in internal/app over the campaigns service.

type MineItem

type MineItem struct {
	ShowingID    string    `json:"showingId"`
	Name         string    `json:"name"`
	ShownAt      time.Time `json:"shownAt"`
	RewatchUntil time.Time `json:"rewatchUntil"`
	Watched      bool      `json:"watched"`
	Stopped      bool      `json:"stopped"`
}

MineItem is one of the caller's own showings still inside its window, in the shape GET /cutscenes/mine sends. Stopped tells the stage not to play a showing the Director called off when the page opens; it can still be watched again by choice.

type Option

type Option func(*service)

Option configures the service.

func WithClock

func WithClock(now func() time.Time) Option

WithClock replaces time.Now, for tests.

func WithPresence

func WithPresence(p Presence) Option

WithPresence adds the "where are they" signal to the Show sheet; without it everyone reads as away.

func WithPublisher

func WithPublisher(p Publisher) Option

WithPublisher wires the live channel; without it a showing is only stored, and players find it in their Watch again list.

type Overlay

type Overlay struct {
	Kind    string  `json:"kind"`
	At      float64 `json:"at"`
	Seconds float64 `json:"seconds"`
	Params  Params  `json:"params"`
}

Overlay is one animation drawn on top of the background, in list order.

type Params

type Params struct {
	Color string `json:"color,omitempty"`
	Look  string `json:"look,omitempty"`
	Pupil string `json:"pupil,omitempty"` // eye only; empty draws its look's own
}

Params are a layer's settings beyond kind and timing: an overlay's colour, and the look of a kind that has several (falling asleep, the eye). An unknown param is dropped when the layer is read.

type Place

type Place struct {
	Chronicle bool
	Foundry   bool
}

Place says where a member is now. Both false is away.

func (Place) Here

func (p Place) Here() bool

Here is true when the member has Chronicle or Foundry open.

func (Place) Words

func (p Place) Words() string

Words is how the Show sheet says a place.

type Presence

type Presence interface {
	Places(ctx context.Context, campaignID string) (map[string]Place, error)
}

Presence says where each member is now; implemented in internal/app over the websocket hub and the Foundry players report, so this plugin imports neither. A member missing from the map is away.

type Publisher

type Publisher interface {
	Show(campaignID string, s Showing)
	Stop(campaignID string, s Showing)
}

Publisher puts a showing on screens and takes it off; implemented in internal/app over the websocket bus. It is told after the database has the showing, so a screen that asks right away can read it.

type ReportViewer

type ReportViewer struct {
	UserID  string `json:"userId"`
	Name    string `json:"name"`
	Watched bool   `json:"watched"`
}

ReportViewer is one person on a showing report.

type Repository

type Repository interface {
	ListScenes(ctx context.Context, campaignID string) ([]Scene, error)
	// GetScene answers NotFound for a scene that is not in the campaign.
	GetScene(ctx context.Context, campaignID, id string) (*Scene, error)
	// CreateScene answers Conflict when the campaign has a scene of that name.
	CreateScene(ctx context.Context, campaignID, createdBy string, s Scene) error
	// UpdateScene answers NotFound for a missing scene and Conflict for a
	// name another scene has.
	UpdateScene(ctx context.Context, campaignID string, s Scene) error
	DeleteScene(ctx context.Context, campaignID, id string) error

	// CreateShowing stores the showing and its viewers in one transaction.
	CreateShowing(ctx context.Context, s Showing) error
	// GetShowing answers NotFound for a showing that is not in the campaign.
	GetShowing(ctx context.Context, campaignID, id string) (*Showing, error)
	// StopShowing stamps stopped_at once; a second stop changes nothing.
	StopShowing(ctx context.Context, campaignID, id string, at time.Time) error
	// RecentShowings lists the campaign's newest showings, viewers included.
	RecentShowings(ctx context.Context, campaignID string, limit int) ([]Showing, error)
	// ViewerShowings lists the showings userID is a viewer of whose window
	// is still open at now, newest first, each with only that viewer.
	ViewerShowings(ctx context.Context, campaignID, userID string, now time.Time) ([]Showing, error)
	// MarkWatched stamps watched_at the first time only.
	MarkWatched(ctx context.Context, campaignID, showingID, userID string, at time.Time) error
}

Repository is the store behind the service.

func NewRepository

func NewRepository(db *sql.DB) Repository

NewRepository creates a MariaDB-backed repository.

type Scene

type Scene struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Background Background `json:"background"`
	Overlays   []Overlay  `json:"overlays"`
	Text       []TextLine `json:"text"`
	Ending     Ending     `json:"ending"`
	UpdatedAt  time.Time  `json:"-"`
}

Scene is a cut scene, in the shape the engine reads and the database keeps (one JSON column per layer).

func NewScene

func NewScene() Scene

NewScene is the scene a "New scene" page starts from: the first built-in animation, the screen falling asleep and a green eye opening, with one whispered line under it.

func Normalize

func Normalize(in Scene) (Scene, error)

Normalize checks a scene and returns it clamped: every number brought into its range and rounded to a tenth of a second, colours lower-cased and filled with the layer's default, words trimmed of control characters. An unknown kind or style, a malformed colour, a missing name or words, too many layers and words over the limit are refused with a sentence the editor can show as it is. The ID is kept as given; the caller decides it.

func SceneFromForm

func SceneFromForm(f url.Values) (Scene, error)

SceneFromForm reads the editor's form into a scene. It only reads: every rule (kinds, ranges, limits) is Normalize's, applied by the service. A number that is not a number is refused here, because "abc seconds" has no clamped meaning.

type Service

type Service interface {
	List(ctx context.Context, campaignID string, v Viewer) ([]Scene, error)
	Get(ctx context.Context, campaignID, sceneID string, v Viewer) (*Scene, error)
	Create(ctx context.Context, campaignID string, v Viewer, in Scene) (*Scene, error)
	// Save replaces the whole scene: the editor posts every layer.
	Save(ctx context.Context, campaignID, sceneID string, v Viewer, in Scene) (*Scene, error)
	Delete(ctx context.Context, campaignID, sceneID string, v Viewer) error
	// Check returns the scene as Save would store it, for the editor's
	// Preview, without storing anything.
	Check(ctx context.Context, campaignID string, v Viewer, in Scene) (Scene, error)

	// Audience lists every member with where they are now, for the Show sheet.
	Audience(ctx context.Context, campaignID string, v Viewer) ([]AudienceRow, error)
	// Show makes a showing of the scene as it is now and puts it on the
	// chosen people's screens.
	Show(ctx context.Context, campaignID, sceneID string, v Viewer, in ShowInput) (*Showing, error)
	// Stop pulls a showing off every screen; its rewatch window stays.
	Stop(ctx context.Context, campaignID, showingID string, v Viewer) (*Showing, error)
	// Recent lists the campaign's newest showings with who watched.
	Recent(ctx context.Context, campaignID string, v Viewer) ([]ShowingReport, error)
	// LiveFor lists a scene's showings that may still be on screens.
	LiveFor(ctx context.Context, campaignID, sceneID string, v Viewer) ([]Showing, error)

	// Mine lists the caller's own showings still inside their window.
	Mine(ctx context.Context, campaignID string, v Viewer) ([]MineItem, error)
	// Read returns one showing's scene for the caller to play.
	Read(ctx context.Context, campaignID, showingID string, v Viewer) (*ShowingRead, error)
	// Watched marks the caller's first play of a showing.
	Watched(ctx context.Context, campaignID, showingID string, v Viewer) error
	// MemberShowings lists one member's showings still inside their window,
	// with the scenes, for the Foundry GM client. The sync API checks the
	// caller is a Director before it asks.
	MemberShowings(ctx context.Context, campaignID, userID string) ([]MemberShowing, error)
}

Service owns every rule about scenes and showings. It never imports Echo: the handlers bind and render, the service decides.

Two sight rules hold everywhere: only a Director (owner or co-DM) reads, writes or shows scenes, and a showing is readable only by the people it was for while its window is open, or by a Director. Anyone else is told it does not exist (404), never that it is not theirs.

func NewService

func NewService(repo Repository, members Members, opts ...Option) Service

NewService builds the service.

type ShowInput

type ShowInput struct {
	To      []string
	Rewatch string // a RewatchChoices key; "" is the default
}

ShowInput is what the Show sheet posts.

func ShowFromForm

func ShowFromForm(f url.Values) ShowInput

ShowFromForm reads the Show sheet: to (repeated) and rewatch.

type Showing

type Showing struct {
	ID           string
	CampaignID   string
	SceneID      string // "" once the scene is deleted
	Scene        Scene  // the scene as it was shown
	ShownBy      string
	ShownAt      time.Time
	RewatchUntil time.Time
	StoppedAt    *time.Time
	Viewers      []ShowingViewer
}

Showing is one play of a scene to named people.

func (Showing) Live

func (s Showing) Live(now time.Time) bool

Live reports whether the showing was put on screens moments ago, which is when the editor lists it as showing.

func (Showing) Stoppable

func (s Showing) Stoppable(now time.Time) bool

Stoppable reports whether Stop still means something: a scene that waits for a tap can stay up long after Live, and a player may be rewatching it, so Stop stays until the showing is stopped or its window closes. A stop with nothing on screen is harmless.

type ShowingRead

type ShowingRead struct {
	ShowingID    string    `json:"showingId"`
	RewatchUntil time.Time `json:"rewatchUntil"`
	Scene        Scene     `json:"scene"`
}

ShowingRead is one showing as a viewer reads it to play it.

type ShowingReport

type ShowingReport struct {
	ShowingID    string         `json:"showingId"`
	SceneID      string         `json:"sceneId,omitempty"`
	Name         string         `json:"name"`
	ShownAt      time.Time      `json:"shownAt"`
	RewatchUntil time.Time      `json:"rewatchUntil"`
	Stopped      bool           `json:"stopped"`
	Live         bool           `json:"live"`
	CanStop      bool           `json:"canStop"`
	Viewers      []ReportViewer `json:"viewers"`
}

ShowingReport is one showing on the Director's recent list.

func ReportOf

func ReportOf(sh Showing, now time.Time) ShowingReport

ReportOf is a showing as the Director's recent list shows it. Viewers' names are the caller's to fill first.

type ShowingViewer

type ShowingViewer struct {
	UserID    string
	Name      string // filled by the service from the member list
	WatchedAt *time.Time
}

ShowingViewer is one person a showing was for.

type TextLine

type TextLine struct {
	Say     string  `json:"say"`
	At      float64 `json:"at"`
	Seconds float64 `json:"seconds"`
	Style   string  `json:"style"`
}

TextLine is one line of words. Say is plain text, never HTML.

type Viewer

type Viewer struct {
	UserID   string
	Director bool
}

Viewer is the person asking, as the service needs them. Director is the campaign owner or a member with DM access (CanAuthorDmOnly).

Jump to

Keyboard shortcuts

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