Add shuffle parameter to playback intent (#1813)

## Description
Adds an optional boolean parameter `shuffle` that is read for the
playback intent. When true, it will cause the resulting media to be
shuffled if applicable.

Something can be shuffled if the `itemId` is a grouping on media such as
a playlist, series, season, or even library.

### Related issues
Depends on #1756

### Testing
Emulator with the documented command

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-08-11 13:33:49 -04:00 • committed by GitHub
parent e94e82479b
commit bd1a6c44ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 3 deletions

View file

@ -90,6 +90,7 @@ sealed class Destination(
val positionMs: Long,
val forceTranscoding: Boolean = false,
val backend: PlayerBackend? = null,
val shuffle: Boolean = false,
) : Destination(true) {
constructor(item: BaseItem) : this(item.id, item.resumeMs)
}

View file

@ -332,10 +332,17 @@ class PlaybackViewModel
filter = destination.filter,
)
} else {
val shuffled =
if (destination is Destination.Playback) {
destination.shuffle
} else {
false
}
// Try to create a playlist
playlistCreator.createFrom(
item = queriedItem,
recursive = true,
shuffled = shuffled,
)
}
when (val r = playlistResult) {