Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ErsatzTV/legacy/llms.txt

Use this file to discover all available pages before exploring further.

Schedules are the programming engine of ErsatzTV. They define what plays on a channel, in what order, and at what times — transforming a library of raw media into a coherent broadcast lineup. Without a schedule attached to a playout, a channel has nothing to air. ErsatzTV Legacy offers four distinct schedule types, each suited to different workflows and levels of control, from simple time-slot grids to fully scripted programming logic.

Why Schedules Exist

A schedule (ProgramSchedule for Classic schedules, or a file-based definition for YAML and Scripted) is the bridge between your media library and your channel. It answers three questions:
  1. What plays — which collections, shows, movies, or playlists are scheduled
  2. When it plays — at fixed clock times or dynamically back-to-back
  3. In what order — chronological, shuffled, random rotation, marathon mode, and more
Schedules are then attached to channels via playouts. A single schedule can be shared across multiple playouts and channels.

Playback Order

Every schedule item references a PlaybackOrder that controls the sequence in which media items are drawn from a collection:
OrderValueDescription
None0No ordering; typically used for single-item slots.
Chronological1Items play in order of release date (oldest first).
Random2A new random item is picked every time, with no memory of what was picked before.
Shuffle3Items are shuffled into a random order and played through before reshuffling. Ensures all items play before repeating.
ShuffleInOrder4Groups items by show/season, shuffles the groups, then plays each group in episode order.
MultiEpisodeShuffle5Like shuffle, but picks multiple consecutive episodes from the same show at a time.
SeasonEpisode6Plays episodes in strict season-then-episode-number order (S01E01, S01E02, …, S02E01, …).
RandomRotation7Rotates through items in a random but balanced way, ensuring variety across playthroughs.
Marathon8Plays all episodes of a show (or group, depending on MarathonGroupBy) in sequence before moving on.
Use SeasonEpisode for a faithful rerun of a series. Use Shuffle or RandomRotation for variety channels where you don’t want the same episode appearing twice in quick succession.

Classic Schedules

A Classic schedule (ProgramSchedule) is the original ErsatzTV scheduling model. It is a named list of program schedule items (ProgramScheduleItem), each representing a content slot that can have a fixed start time or a dynamic (back-to-back) start time. Key properties of a Classic schedule:
PropertyDescription
NameThe display name for the schedule.
KeepMultiPartEpisodesTogetherWhen true, multi-part episodes (e.g. “Part 1/Part 2”) are kept together as a single scheduling unit.
TreatCollectionsAsShowsWhen true, collection items are treated as a single show for the purposes of season/episode ordering.
ShuffleScheduleItemsWhen true, the order of schedule items is randomized each time the playout is built.
RandomStartPointWhen true, playback begins at a random point within the collection rather than from the beginning.
FixedStartTimeBehaviorControls how fixed-time slots behave — Strict (hard start, cut off previous item if needed) or Flexible (wait for the current item to finish).

Schedule Item Playout Modes

Each ProgramScheduleItem carries a PlayoutMode that controls how many items are drawn from the collection for that slot:
ModeDescription
FloodPlay items from the collection back-to-back until the next fixed-time slot is reached.
OnePlay exactly one item from the collection and then advance to the next schedule item.
MultiplePlay a fixed number of items (configured on the item).
DurationPlay items from the collection until a specified total duration has been filled.

Filler in Classic Schedules

Each schedule item supports five categories of filler preset:
  • Pre-Roll — plays immediately before the main content
  • Mid-Roll — inserted between items in a multi-item slot
  • Post-Roll — plays immediately after the main content
  • Tail — fills the remaining time at the end of a fixed-duration slot
  • Fallback — a last-resort filler if no other filler applies

Classic Schedules

Set up time-slot grids with fixed start times, flood fill, and per-item filler presets.

Block Schedules

Build template-driven programming blocks with Deco overlays and precise time budgets.

YAML Schedules

Define your channel’s schedule declaratively in a structured YAML file.

Scripted Schedules

Write Python scripts to generate fully dynamic, algorithmically driven programming.

Block Schedules

Block scheduling uses a template and deco system. Instead of a flat list of time slots, you define reusable programming blocks — each block has a fixed duration and a set of content instructions. Blocks are assembled into templates that define a full day’s worth of programming. A Block playout can be configured with a Deco (decoration), which layers additional content or graphics onto the block’s output. The PlayoutTemplate entity maps a template to specific days of the week, days of the month, months of the year, and optional date ranges — giving you fine-grained seasonal and weekday-aware scheduling. ErsatzTV maintains playout history for Block schedules, tracking which items were played per block and collection so that playback can resume correctly after a rebuild.
Playout history is exclusively maintained for Block schedules. This history ensures that after a playout reset or daily rebuild, ErsatzTV resumes each block’s collection from where it left off rather than starting over from the beginning.

YAML Schedules (Sequential)

The Sequential schedule kind (internally PlayoutScheduleKind.Sequential) uses a YAML-formatted file (ScheduleFile) to define the playout sequence declaratively. A YAML schedule describes the full programming structure in a human-readable, version-controllable text file, making it easy to replicate, share, or automate schedule creation. The YAML file is referenced by the playout’s ScheduleFile property and is re-read whenever the playout is rebuilt.

Scripted Schedules

Scripted schedules (PlayoutScheduleKind.Scripted) let you write a Python script that programmatically generates playout instructions. The script has access to ErsatzTV’s Scripted Schedule API, which provides functions to query media, build time slots, and emit scheduling decisions at runtime. Scripted schedules are the most powerful option — they allow conditional logic, external data lookups, dynamic time math, and any algorithm you can express in Python.

External JSON (ExternalJson)

PlayoutScheduleKind.ExternalJson allows ErsatzTV to consume a pre-built playout timeline delivered as a JSON document from an external source. This is useful for integrating ErsatzTV with external scheduling tools or automation pipelines that produce their own program data.

Schedule Kind Reference

The PlayoutScheduleKind enum lists all schedule types supported by a playout:
KindValueDescription
None0No schedule assigned. The playout has no content.
Classic1A Classic (ProgramSchedule-based) schedule.
Block2A Block schedule driven by templates and decos.
Sequential3A YAML-based declarative schedule file.
Scripted4A Python-scripted schedule.
ExternalJson20An externally provided JSON playout document.

Schedule Items and Collections

Regardless of schedule type, content is always referenced through a collection type (CollectionType). A single schedule item can point to:
  • A Collection — a manually curated list of media items
  • A Multi-Collection — a group of collections treated as one pool
  • A Smart Collection — a dynamic collection defined by a search query
  • A Playlist — an ordered list of items
  • A Single Media Item — one specific movie, episode, or other item
  • A Search Query — inline search expression evaluated at build time
This flexibility means schedules work with any combination of your library content, regardless of how it is organized.

Alternate Schedules

Classic schedule playouts support alternate schedules (ProgramScheduleAlternates). An alternate schedule can override the primary schedule for specific days of the week, date ranges, or other conditions. This allows seasonal overrides (e.g. a Christmas programming block that activates in December) without requiring you to create a separate playout for every variation.

Build docs developers (and LLMs) love