Skip to content

feat(viewer): make skipping the on-screen asset on playlist removal optional - #3325

Open
vpetersson-bot wants to merge 2 commits into
masterfrom
fix/siri-65-skip-on-playlist-removal
Open

vpetersson-bot wants to merge 2 commits into
masterfrom
fix/siri-65-skip-on-playlist-removal

Conversation

@vpetersson-bot

Copy link
Copy Markdown
Contributor

Issues Fixed

Forum report: Skipping asset when removed from playlist. Since the "skip deleted/deactivated asset immediately" change, taking an asset out of the playlist while it is on screen cuts its rotation short. The reporter's operating procedure relies on the older behaviour, where the asset finished what it was showing and simply did not come round again, and asked for a way to choose.

Reproduced on the testbed (Pi 3 64-bit and x86, v2026.8.2): a 300s image removed from the playlist 10 seconds in came off the screen instantly. The same reproduction also surfaced a second, unreported problem — the asset after the removed one lost its turn as well.

Description

1. skip_deactivated_asset setting (default on, so nothing changes on upgrade).

The viewer's reload handler now separates two cases that were treated alike:

  • Deleted asset — always comes off the screen immediately. delete_asset_with_file unlinks the media alongside the row, so there is nothing coherent left to show.
  • Deactivated asset (disabled, removed from the playlist, or its schedule window closed) — governed by the new setting. On: skip immediately, as today. Off: let the asset finish the rotation it already started; the playlist is still rebuilt, so it does not come round again.

Exposed as a toggle on the Settings page and on the v2 device-settings API.

2. Playlist cursor no longer loses an asset when the list shrinks.

Scheduler.index points at the asset due to play next and update_playlist() held it as a bare numeric position. When the playlist shrinks ahead of the cursor the tail slides back one slot and the stale index lands past the asset that was up next. Removing the asset on screen is the everyday way to hit it: on a three-asset playlist the operator drops one asset and two come off the rotation. The cursor is now re-anchored by asset id, falling back to the old modulo when the up-next asset is gone too.

Validation

End-to-end on real hardware (Pi 3 64-bit and x86, overlaying these commits onto the v2026.8.2 image):

  • Setting on (default): removing the on-screen asset still skips immediately, and the next asset in play order now gets its turn instead of being passed over.
  • Setting off: the removed asset played its full 120s, then rotation advanced and it did not reappear.
  • Setting off plus a delete: still skips immediately.
  • Settings page renders the toggle and the form save persists it; v2 API GET/PATCH round-trip.

Unit suite (2060 tests), ruff check, ruff format --check and mypy all pass locally. Both testbeds were restored to their pinned image and original playlist state afterwards.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

vpetersson-bot and others added 2 commits September 11, 2026 16:23
…ylist

Adds a `skip_deactivated_asset` setting (default on, so existing
behaviour is unchanged) controlling what happens to the asset on
screen when the operator removes it from the playlist.

- On: cut the rotation short immediately, as shipped since the
  skip-deleted-or-deactivated-asset fix.
- Off: let the asset finish the rotation it already started; the
  playlist is still rebuilt, so it doesn't come round again. This is
  the pre-fix behaviour operators who curate a running playlist asked
  to get back.
- A deleted asset always comes off the screen immediately regardless
  of the setting — delete_asset_with_file unlinks the media alongside
  the row, so there is nothing coherent left to show.

Exposed on the Settings page and through the v2 device-settings API.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Scheduler.index points at the asset due to play next, and
update_playlist() held it as a bare numeric position. When the
playlist shrinks *ahead* of the cursor the tail slides back one slot
and the stale index lands past the asset that was up next, so it
silently loses its turn.

Removing the asset currently on screen is the everyday way to hit
this: on a three-asset playlist the operator drops one asset and two
come off the rotation.

Re-anchor the cursor by asset id, falling back to the old modulo when
the up-next asset is gone too (which still keeps an append at the end
of the list from restarting the play-through).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 16:52
@vpetersson-bot
vpetersson-bot requested a review from a team as a code owner September 11, 2026 16:52
@vpetersson-bot vpetersson-bot self-assigned this Sep 11, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sonarqubecloud

Copy link
Copy Markdown

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