Add Play/Shuffle All buttons to playlists context menu

This commit is contained in:
Arkadiusz Fal 2022-01-02 20:39:54 +01:00
parent e29982454b
commit aec7480353

View File

@ -17,10 +17,11 @@ struct AppSidebarPlaylists: View {
} }
.id(playlist.id) .id(playlist.id)
.contextMenu { .contextMenu {
Button("Add to queue...") { Button("Play All") {
playlists.find(id: playlist.id)?.videos.forEach { video in player.play(playlists.find(id: playlist.id)?.videos ?? [])
player.enqueueVideo(video)
} }
Button("Shuffle All") {
player.play(playlists.find(id: playlist.id)?.videos ?? [], shuffling: true)
} }
Button("Edit") { Button("Edit") {
navigation.presentEditPlaylistForm(playlists.find(id: playlist.id)) navigation.presentEditPlaylistForm(playlists.find(id: playlist.id))