iOS 1.0.2: shuffle the whole library from Songs
Shuffle used only the pages loaded so far (the A and B songs). It now asks Plex for 1000 random tracks from the whole library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ddfe051d8
commit
a0726b07a1
4 files changed
+17
-4
No files matched your search
@@ -235,6 +235,14 @@ struct SongsScreen: View {
|
||||
@State private var error: String?
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
/// Shuffles the whole library, not just the pages loaded so far.
|
||||
private func shuffleAll() {
|
||||
Task {
|
||||
do { g.playback.playTracks(try await g.plex.randomTracks(1000), shuffle: true) }
|
||||
catch { g.playback.report("Couldn't load songs: \(error.localizedDescription)") }
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Page(title: "Songs") {
|
||||
if !tracks.isEmpty {
|
||||
@@ -242,7 +250,7 @@ struct SongsScreen: View {
|
||||
Text(songs(total)).font(.subheadline).foregroundStyle(p.label2).padding(.leading, MARGIN).padding(.bottom, 12)
|
||||
}
|
||||
PlayShuffle(play: { g.playback.playTracks(Array(tracks.prefix(1000))) },
|
||||
shuffle: { g.playback.playTracks(Array(tracks.prefix(1000)), shuffle: true) })
|
||||
shuffle: shuffleAll)
|
||||
.padding(.bottom, 12)
|
||||
}
|
||||
ForEach(Array(tracks.enumerated()), id: \.element.id) { i, t in
|
||||
|
||||
Reference in new issue
Block a user