Skip to content

Playlist generator: timed inserts, times of day, preview; scheduler: repeating events that insert playlist items - #18

Merged
epell-development merged 5 commits into
mainfrom
claude/project-thread-zhdc56
Oct 26, 2026
Merged

epell-development merged 5 commits into
mainfrom
claude/project-thread-zhdc56

Conversation

@epell-development

@epell-development epell-development commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Requested by epell · project thread

For v0.2.9: "Please improve the auto playlist generator massively, add custom times and stuff (similar to advert/jingle generator)" and "Let me insert stuff from the Playlist dropdown on event scheduler and improve event scheduler, e.g. every 1 hour i can put a time announcement".

Playlist generator

  • Inserts work like advert / jingle rules: after every N songs, every N minutes (optionally on the clock, e.g. at the top of each hour) or at set times (18:00, 20:30…). Each one can be limited to certain hours.
  • An insert can be a time announcement, a category, or an advert / jingle rule's files.
  • Times of day: a different pattern for some hours and days, e.g. talk-heavy weekday mornings 06–10.
  • Length can be "until hh:mm" as well as a number of minutes.
  • Song separation: the same song doesn't come back within N minutes.
  • Categories take several genres (Rock, Pop), a year range, and words to leave out (live, remix).
  • Preview: see the running order with start times, then put it in the playlist (replacing it or after it), try again, or close it.
  • Rows are laid out along the clock from where they will actually start, so the auto-playlist and Append line up timed inserts and times of day with real air time.
  • Generator UI moved from app.rs into genui.rs, laid out in numbered sections like the Advertisement scheduler.

Event scheduler

  • New action Insert a playlist item: time announcement, text to speech, Track List, container, URL stream, line input, teaser, timed pause or command. It goes in after the track on air or plays now, and it's edited with the same dialogs as the Playlist menu. If the last one hasn't played yet, it isn't added a second time.
  • Changing an event's item needs the Scheduler tool permission.
  • Repeat every N minutes / hours until a time, which also works over midnight.
  • An Hourly time announcement button, and Duplicate for events.
  • Playlist event rows don't offer the new action, because they can't hold an item.

Website

  • The Playlist generator and Event scheduler guides now cover the new features.
  • The Event scheduler guide said the encoder action counts from #0. That was wrong: the editor counts from 1, like ENCODER START 1, and the guide now says so.

Compatibility

Saved templates, inserts and events load as before. New fields default to the old behaviour, and old inserts stay "every N minutes". The server runs the same code, so remote setups work once both sides are on this version.

Testing

  • Locally, cargo clippy --all-targets -D warnings on Rust 1.99, cargo fmt --check, cargo test (77 app and 63 server tests), the server smoke test, check_glyphs, check_site, check_versions and the generated-files check all pass. CI is green.
  • New tests cover:
    • on-the-clock time announcements
    • set-time and after-N-songs inserts with hour limits
    • times of day with "until"
    • song separation
    • category filters
    • repeating events, including over midnight, and loading old events
    • the scheduler inserting an item
    • preview and "use it"
  • I ran the app under Xvfb with a test library and checked the Generator, the Preview and the Scheduler, including editing a scheduled speech item. Nothing was cut off.
  • I haven't tested it on real audio hardware.

Release notes (for the v0.2.9 CHANGELOG)

New

  • Playlist generator: inserts after N songs, every N minutes (on the clock) or at set times, with hour limits; time announcements as inserts; different patterns for times of day; "until hh:mm" length; song separation; categories with several genres, years and excluded words; a preview before the running order goes in
  • Event scheduler: insert any playlist item (time announcement, speech, Track List, stream…) and repeat events every N minutes or hours

🤖 Generated with Claude Code

https://claude.ai/code/session_01SALpsdH5pZy8hiDxXkvWD3

…repeating events that insert playlist items

Generator
- Inserts work like advert / jingle rules: after every N songs, every N minutes
  (optionally on the clock) or at set times, each limited to hours
- Inserts can be a time announcement as well as a category or a rule's files
- Times of day: a different pattern for some hours and days (e.g. weekday mornings)
- Length can be "until hh:mm" as well as a number of minutes
- Song separation (minutes before the same song comes back)
- Categories take several genres, a year range and words to leave out
- Preview the running order with start times, then put it in, try again or close
- Rows are laid out along the clock from where they will start, so the auto-playlist
  and append follow the real air time
- Generator UI moved to genui.rs

Scheduler
- New action: insert a playlist item (time announcement, text to speech, Track List,
  container, stream, line input, teaser, pause, command) after the track on air or now,
  edited with the same dialogs as the Playlist menu
- Events can repeat every N minutes / hours until a time (over midnight too)
- "Hourly time announcement" shortcut and Duplicate

Saved templates and events load as before (new fields default to the old behaviour).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SALpsdH5pZy8hiDxXkvWD3
@epell-development epell-development self-assigned this Oct 25, 2026

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeGuard review
Risk: 🟠 35/100 — moderate
Findings: 🟠 1 medium

Recommended fixes

  • src/playout.rs — Strengthen waiting-item comparison to avoid suppressing distinct inserts that happen to share a title. Match on the row kind and compare a stable identity (e.g., file path for Track, URL for Url, kind-only for TimeAnnounce). (confidence 68%)
    Open Files changed for 1 inline review thread on the diff.

💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply @mergeguards fix on any inline finding.

⚠️ This PR may benefit from a deep scan — consider triggering @mergeguards deep-scan.


Reviewed by MergeGuard AI

Comment thread src/playout.rs
@mergeguards

mergeguards Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

MergeGuard agent actions

Fix all findings

All issues (2)
  • medium · src/playout.rs:2736 — Duplicate-prevention for inserted playlist item only checks kind and title. Different items that share the same title (e.g., two text-to-speech lines with same title but different text, or differen…
  • medium · src/playout.rs:2509 — Generator considers output as 'nothing' unless it contains at least one non-insert track. Templates that intentionally produce only timed inserts (e.g., time announcements or jingles) will be rejec…

Apply auto-fixes for the findings above on this branch:

  • Fix All MergeGuard Findings

Or reply with @mergeguards fix-all on this pull request.

…cks) into the generator branch

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SALpsdH5pZy8hiDxXkvWD3

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ MergeGuard — new commits are on this pull request.

Re-scan the latest diff: paste this line by itself (copy/paste is fine) — either on the Conversation tab (Add a comment) or on Files changed as a comment on the diff:

@mergeguard-followup

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeGuard review
Risk: 🟠 55/100 — moderate
Findings: 🔴 2 high

Recommended fixes

  • src/config.rs — Ensure Category deserializes old configs by defaulting new fields. (confidence 90%)
  • src/scheduler.rs — Preserve backward compatibility for Event by defaulting newly added fields during deserialization. (confidence 95%)
    Open Files changed for 2 inline review threads on the diff.

💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply @mergeguards fix on any inline finding.


Reviewed by MergeGuard AI

Comment thread src/config.rs
Comment thread src/scheduler.rs
…nd repeating scheduler events

Also fixes the event scheduler guide, which said the encoder action counts from #0;
the editor shows encoders from 1, like the ENCODER START command.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SALpsdH5pZy8hiDxXkvWD3

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ MergeGuard — new commits are on this pull request.

Re-scan the latest diff: paste this line by itself (copy/paste is fine) — either on the Conversation tab (Add a comment) or on Files changed as a comment on the diff:

@mergeguard-followup

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeGuard review
Risk: 🟠 35/100 — moderate
Findings: 🟠 1 medium

Recommended fixes

  • src/pltools.rs — Restore strict permission gating for the item dialog so that users without playlist edit rights cannot edit scheduler event items. Ideally, replace with a dedicated scheduler permission if available. (confidence 62%)
Security review — 🟠 1 medium (1 finding)

Dependency, filesystem & container image checks (OSV + Trivy + container scan) for this pull request.
All items below are also on Files changed as inline threads.
See Files changed for security threads on this diff.

__Open **Files changed** for 1 inline review thread on the diff.__

💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply @mergeguards fix on any inline finding.


Reviewed by MergeGuard AI

Comment thread src/pltools.rs Outdated
…ssion

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SALpsdH5pZy8hiDxXkvWD3

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ MergeGuard — new commits are on this pull request.

Re-scan the latest diff: paste this line by itself (copy/paste is fine) — either on the Conversation tab (Add a comment) or on Files changed as a comment on the diff:

@mergeguard-followup

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeGuard review
Risk: 🟠 35/100 — moderate
Findings: 🟠 2 medium

Recommended fixes

  • src/playout.rs — Make duplicate-prevention for inserted playlist items more specific to avoid false positives by also checking artist (or use a more robust equality where possible). (confidence 66%)
  • src/playout.rs — Allow generator outputs that contain only inserts (e.g., time announcements) to be accepted, while keeping a helpful log when there are no music/file tracks. (confidence 64%)
    Open Files changed for 2 inline review threads on the diff.

💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply @mergeguards fix on any inline finding.


Reviewed by MergeGuard AI

Comment thread src/playout.rs
Comment thread src/playout.rs
The scheduler window and the generator's start time use the station clock (core.now()),
like the rest of the app now does when connected to a server.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SALpsdH5pZy8hiDxXkvWD3

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ MergeGuard — new commits are on this pull request.

Re-scan the latest diff: paste this line by itself (copy/paste is fine) — either on the Conversation tab (Add a comment) or on Files changed as a comment on the diff:

@mergeguard-followup

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeGuard review
Risk: 🟢 0/100 — low risk
Findings: none


Reviewed by MergeGuard AI

@epell-development
epell-development merged commit 56dfdd5 into main Oct 26, 2026
6 checks passed
epell-development pushed a commit that referenced this pull request Oct 26, 2026
Keeps this branch's server update check (selfupdate, ServerCfg.check_updates)
as the one source of ServerInfo.latest and drops #19's second update thread;
the release page now comes from the same release. AzuraCast calls from the
portal need the AzuraCast permission. Playlist Insert/RemoveRows commands need
edit_playlists. The generator's category folder picker (moved to genui.rs)
goes through App::pick.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5uW8ddhUDidYMFx9SLghq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants