From c4272c86f760357ef147045a495694339a5bce30 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 19 Oct 2026 23:26:41 +0200 Subject: [PATCH] Start playlist Play at a random video in shuffle mode (#988) Play always started from the first video, so shuffle only affected the rest of the session. When the queue mode is Shuffle, rotate the list to a random start so the remaining videos stay queued. --- Yattee/Views/Playlist/UnifiedPlaylistDetailView.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Yattee/Views/Playlist/UnifiedPlaylistDetailView.swift b/Yattee/Views/Playlist/UnifiedPlaylistDetailView.swift index aa9af67a..e720b0ce 100644 --- a/Yattee/Views/Playlist/UnifiedPlaylistDetailView.swift +++ b/Yattee/Views/Playlist/UnifiedPlaylistDetailView.swift @@ -1221,8 +1221,17 @@ struct UnifiedPlaylistDetailView: View { private func playAll() { guard !videos.isEmpty, let appEnvironment else { return } + // In shuffle mode start from a random video (#988). Rotate rather than + // pick an index so every other video stays in the queue instead of + // being pushed to history as "already played". + var orderedVideos = videos + if appEnvironment.playerService.state.queueMode == .shuffle { + let start = Int.random(in: 0..