feat(schedule): add loop and recycle policy options to programming blocks

This commit is contained in:
2026-03-13 01:53:02 +01:00
parent eeb4e2cb41
commit 6a4eb099cb
5 changed files with 111 additions and 22 deletions

View File

@@ -164,6 +164,20 @@ pub struct ProgrammingBlock {
/// possible; remaining time at the end becomes dead air (no-signal).
pub duration_mins: u32,
pub content: BlockContent,
/// Sequential only: loop back to episode 1 after the last episode. Default: true.
#[serde(default = "default_true")]
pub loop_on_finish: bool,
/// When true, skip the channel-level recycle policy for this block.
/// Useful for dedicated sequential blocks that must always play in order
/// regardless of what other blocks aired.
#[serde(default)]
pub ignore_recycle_policy: bool,
}
fn default_true() -> bool {
true
}
impl ProgrammingBlock {
@@ -180,6 +194,8 @@ impl ProgrammingBlock {
start_time,
duration_mins,
content: BlockContent::Algorithmic { filter, strategy },
loop_on_finish: true,
ignore_recycle_policy: false,
}
}
@@ -195,6 +211,8 @@ impl ProgrammingBlock {
start_time,
duration_mins,
content: BlockContent::Manual { items },
loop_on_finish: true,
ignore_recycle_policy: false,
}
}
}