From 52697ef8910708d10a811c8e7f25d26571f23bb6 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Sat, 11 Nov 2023 23:01:51 -0700 Subject: [PATCH] detail: allow adding to playlist in playlist The playback view can still add to a playlist from a playlist, so I have to implement this navigation route no matter what. --- .../java/org/oxycblt/auxio/detail/PlaylistDetailFragment.kt | 6 +++++- app/src/main/res/navigation/inner.xml | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/oxycblt/auxio/detail/PlaylistDetailFragment.kt b/app/src/main/java/org/oxycblt/auxio/detail/PlaylistDetailFragment.kt index ed460bc33..540017724 100644 --- a/app/src/main/java/org/oxycblt/auxio/detail/PlaylistDetailFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/detail/PlaylistDetailFragment.kt @@ -328,7 +328,11 @@ class PlaylistDetailFragment : logD("Deleting ${decision.playlist}") PlaylistDetailFragmentDirections.deletePlaylist(decision.playlist.uid) } - is PlaylistDecision.Add, + is PlaylistDecision.Add -> { + logD("Adding ${decision.songs.size} songs to a playlist") + PlaylistDetailFragmentDirections.addToPlaylist( + decision.songs.map { it.uid }.toTypedArray()) + } is PlaylistDecision.New -> error("Unexpected playlist decision $decision") } findNavController().navigateSafe(directions) diff --git a/app/src/main/res/navigation/inner.xml b/app/src/main/res/navigation/inner.xml index a974b3360..43c0d52c3 100644 --- a/app/src/main/res/navigation/inner.xml +++ b/app/src/main/res/navigation/inner.xml @@ -379,6 +379,9 @@ +