feat(viewer): make skipping the on-screen asset on playlist removal optional - #3325
Open
vpetersson-bot wants to merge 2 commits into
Open
vpetersson-bot wants to merge 2 commits into
vpetersson-bot wants to merge 2 commits into
Conversation
…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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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_assetsetting (default on, so nothing changes on upgrade).The viewer's reload handler now separates two cases that were treated alike:
delete_asset_with_fileunlinks the media alongside the row, so there is nothing coherent left to show.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.indexpoints at the asset due to play next andupdate_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):
Unit suite (2060 tests),
ruff check,ruff format --checkandmypyall pass locally. Both testbeds were restored to their pinned image and original playlist state afterwards.Checklist
🤖 Generated with Claude Code