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.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.
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:
- What plays — which collections, shows, movies, or playlists are scheduled
- When it plays — at fixed clock times or dynamically back-to-back
- In what order — chronological, shuffled, random rotation, marathon mode, and more
Playback Order
Every schedule item references aPlaybackOrder that controls the sequence in which media items are drawn from a collection:
| Order | Value | Description |
|---|---|---|
None | 0 | No ordering; typically used for single-item slots. |
Chronological | 1 | Items play in order of release date (oldest first). |
Random | 2 | A new random item is picked every time, with no memory of what was picked before. |
Shuffle | 3 | Items are shuffled into a random order and played through before reshuffling. Ensures all items play before repeating. |
ShuffleInOrder | 4 | Groups items by show/season, shuffles the groups, then plays each group in episode order. |
MultiEpisodeShuffle | 5 | Like shuffle, but picks multiple consecutive episodes from the same show at a time. |
SeasonEpisode | 6 | Plays episodes in strict season-then-episode-number order (S01E01, S01E02, …, S02E01, …). |
RandomRotation | 7 | Rotates through items in a random but balanced way, ensuring variety across playthroughs. |
Marathon | 8 | Plays all episodes of a show (or group, depending on MarathonGroupBy) in sequence before moving on. |
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:
| Property | Description |
|---|---|
Name | The display name for the schedule. |
KeepMultiPartEpisodesTogether | When true, multi-part episodes (e.g. “Part 1/Part 2”) are kept together as a single scheduling unit. |
TreatCollectionsAsShows | When true, collection items are treated as a single show for the purposes of season/episode ordering. |
ShuffleScheduleItems | When true, the order of schedule items is randomized each time the playout is built. |
RandomStartPoint | When true, playback begins at a random point within the collection rather than from the beginning. |
FixedStartTimeBehavior | Controls 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
EachProgramScheduleItem carries a PlayoutMode that controls how many items are drawn from the collection for that slot:
| Mode | Description |
|---|---|
Flood | Play items from the collection back-to-back until the next fixed-time slot is reached. |
One | Play exactly one item from the collection and then advance to the next schedule item. |
Multiple | Play a fixed number of items (configured on the item). |
Duration | Play 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 aDeco (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
ThePlayoutScheduleKind enum lists all schedule types supported by a playout:
| Kind | Value | Description |
|---|---|---|
None | 0 | No schedule assigned. The playout has no content. |
Classic | 1 | A Classic (ProgramSchedule-based) schedule. |
Block | 2 | A Block schedule driven by templates and decos. |
Sequential | 3 | A YAML-based declarative schedule file. |
Scripted | 4 | A Python-scripted schedule. |
ExternalJson | 20 | An 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
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.