Documentation
¶
Overview ¶
Package markers supplies release-duration-specific skip ranges. Remote lookups are opt-in and cached; no submissions are ever sent.
Index ¶
- type Coverage
- type DialogueCue
- type Marker
- type Options
- type Service
- func (s *Service) Coverage(ctx context.Context, show int64) (Coverage, error)
- func (s *Service) Handler() http.Handler
- func (s *Service) Markers(ctx context.Context, key core.RatingKey, info core.MediaInfo) ([]Marker, error)
- func (s *Service) Prune(ctx context.Context) (int64, error)
- func (s *Service) Put(ctx context.Context, key core.RatingKey, d time.Duration, ranges []Marker) error
- type Stinger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialogueCue ¶
DialogueCue is one already-available subtitle cue time (text not needed).
type Marker ¶
type Marker struct {
Type string `json:"type"`
StartMS int64 `json:"startTimeOffset"`
EndMS int64 `json:"endTimeOffset"`
Final bool `json:"final"`
Source string `json:"source"`
}
func ApplyStingers ¶
ApplyStingers cuts stinger ranges out of credits markers, splitting one credits marker into the pieces before and after each stinger. Pieces under two seconds are dropped (a breath of crawl is not skippable). Afterwards exactly the last credits marker may be Final, and only when it reaches the end of the media — the shape PMS emits.
func FromChapters ¶
FromChapters uses explicit chapter labels only; generic Chapter 01 is not evidence.
type Options ¶
type Options struct {
Config func() (bool, string) // current TheIntroDB enabled state and optional end-user key
Logger *slog.Logger
DB *sql.DB
Enabled bool
BaseURL string
APIKey string
HTTPClient *http.Client
TTL time.Duration
Now func() time.Time
// Aligner, when set, shifts TheIntroDB markers from the reference
// runtime they were submitted against into the played release's
// timeline (dialogue-based, no video downloaded).
Aligner core.TimelineAligner
// AlignTimeout bounds one marker-shifting alignment (default 10s);
// on failure the unshifted markers are kept.
AlignTimeout time.Duration
// Dialogue supplies already-available subtitle cue times for the
// played release (cached sidecars), used for stinger detection.
Dialogue func(ctx context.Context, key core.RatingKey, info core.MediaInfo) ([]DialogueCue, bool)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Coverage ¶
Coverage counts observed cached episodes; it does not imply coverage of the show's entire catalogue or that an official client displayed skip controls.
func (*Service) Handler ¶
Handler serves GET /shows/{TMDBID}, behind the owner's admin authentication.
func (*Service) Markers ¶
func (s *Service) Markers(ctx context.Context, key core.RatingKey, info core.MediaInfo) ([]Marker, error)
Markers returns the skip ranges for one probed release: chapter and remote markers (shifted into this release's timeline when they were submitted against a different cut), with stinger scenes cut out of the credits ranges.
type Stinger ¶
Stinger is a scene inside the credits range that must not be skipped.
func StingersFromChapters ¶
StingersFromChapters finds post-credits scenes in the chapter layout: explicitly named stinger chapters, and the structural pattern of a short chapter sandwiched after a long credits chapter near the tail.
func StingersFromDialogue ¶
func StingersFromDialogue(cues []DialogueCue, creditsStart, duration time.Duration) []Stinger
StingersFromDialogue finds dialogue clusters that resume well inside the credits range after a long cue gap: the shape of a mid-/post-credits scene. Lyrics running continuously from the credits start never qualify, because their first cue follows the credits start without a long gap and their cues continue without one.