Okay, I had to make some changes to the YAML playout system to support this, but they were good changes to make in any case. Changes:
- YAML playout: add `stop_before_end` setting to `pad_until` and `duration` instructions
- When `stop_before_end: false`, content can run over the desired time before executing the next instruction
- YAML playout: add `offline_tail` setting to `pad_until` instruction
- This can be used to stop primary content before the desired time (`stop_before_end: true` and `offline_tail: false`)
- You can then have a second `pad_until` with the same target time and different content
- YAML playout: make `tomorrow` an expression on `pad_until` instruction
- `true` and `false` still work as normal
- The current time (as a decimal) can also be used in the expression, e.g. `now > 23`
- `now = hours + minutes / 60.0 + seconds / 3600.0`
- So `10:30 AM` would be `10.5`, `10:45 PM` would be `22.75`, etc
And YAML schedule (you will need to tweak the queries to match your content):
content:
- search:
key: "CARTOONS"
query: "type:episode AND show_title:\"Captain Planet\""
order: "shuffle"
- search:
key: "ANIME"
query: "type:episode AND show_genre:anime"
order: "shuffle"
- search:
key: "LIVE_ACTION"
query: "type:episode AND show_title:Frasier"
order: "shuffle"
- search:
key: "LIVE_ACTION_FILLER"
query: "type:other_video"
order: "shuffle"
- show:
key: "LATE_NIGHT_WITH_CONAN"
guids:
- source: "tvdb"
value: "289574" #"76737"
- source: "imdb"
value: "tt3697842" #"tt0106052"
order: "shuffle"
- search:
key: "SCI_FI"
query: "type:episode AND show_title:Legion"
order: "shuffle"
reset:
- wait_until: "05:00"
tomorrow: false
rewind_on_reset: true
playout:
- pad_until: "09:00"
tomorrow: false
content: "CARTOONS"
stop_before_end: false
- pad_until: "18:30"
tomorrow: false
content: "ANIME"
stop_before_end: false
- pad_until: "23:00"
tomorrow: false
content: "LIVE_ACTION"
stop_before_end: true
offline_tail: false
- pad_until: "23:00"
tomorrow: false
content: "LIVE_ACTION_FILLER"
trim: true
stop_before_end: true
filler_kind: "postroll"
- count: 1
content: "LATE_NIGHT_WITH_CONAN"
- pad_until: "05:00"
tomorrow: "now > 23"
content: "SCI_FI"
stop_before_end: false
- repeat: true