Skip to content

Replace full-library media session queue with 2-item current+next queue#56

Merged
c0dev0id merged 2 commits into
mainfrom
claude/debug-playlist-switching-w5sjr
Mar 3, 2026
Merged

Replace full-library media session queue with 2-item current+next queue#56
c0dev0id merged 2 commits into
mainfrom
claude/debug-playlist-switching-w5sjr

Conversation

@c0dev0id

@c0dev0id c0dev0id commented Mar 3, 2026

Copy link
Copy Markdown
Owner

The media session queue previously contained every song in the library (500-2000+ items), sent via Binder IPC on every song change. This could trigger TransactionTooLargeException, and since the queue update shared a try-catch with updatePlaybackState(), notification, and UI updates, a single failure would freeze all session state for external controllers.

Changes:

  • Replace full-library queue with 2-item queue (current + next song) with full metadata and cover art, per MediaSession standard
  • Pre-select next song via PlaylistManager.selectNextQueueSong() (sequential when shuffle off, random when shuffle on)
  • All skip and auto-advance paths use the pre-selected next song, so the queued item always matches what actually plays
  • Isolate queue update in its own try-catch so failures don't block playback state, notification, or UI updates
  • Remove repeat mode (shuffle off wraps last→first, shuffle on plays endlessly random)
  • Remove notifyChildrenChanged() from song changes (browse tree only changes on folder rescan)

claude and others added 2 commits March 3, 2026 10:28
…ue (#55)

The media session queue previously contained every song in the library
(500-2000+ items), sent via Binder IPC on every song change. This could
trigger TransactionTooLargeException, and since the queue update shared
a try-catch with updatePlaybackState(), notification, and UI updates,
a single failure would freeze all session state for external controllers.

Changes:
- Replace full-library queue with 2-item queue (current + next song)
  with full metadata and cover art, per MediaSession standard
- Pre-select next song via PlaylistManager.selectNextQueueSong()
  (sequential when shuffle off, random when shuffle on)
- All skip and auto-advance paths use the pre-selected next song,
  so the queued item always matches what actually plays
- Isolate queue update in its own try-catch so failures don't block
  playback state, notification, or UI updates
- Remove repeat mode (shuffle off wraps last→first, shuffle on plays
  endlessly random)
- Remove notifyChildrenChanged() from song changes (browse tree only
  changes on folder rescan)

https://claude.ai/code/session_01VWnwPnvGVt3i4QRTbyM47p
@c0dev0id
c0dev0id merged commit a7a95e4 into main Mar 3, 2026
2 checks passed
@c0dev0id
c0dev0id deleted the claude/debug-playlist-switching-w5sjr branch March 3, 2026 10:35
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