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.
This commit is contained in:
Alexander Capehart 2023-11-11 23:01:51 -07:00
parent a99b0ff615
commit 52697ef891
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 8 additions and 1 deletions

View file

@ -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)

View file

@ -379,6 +379,9 @@
<action
android:id="@+id/delete_playlist"
app:destination="@id/delete_playlist_dialog" />
<action
android:id="@+id/add_to_playlist"
app:destination="@id/add_to_playlist_dialog" />
<action
android:id="@+id/play_from_artist"
app:destination="@id/play_from_artist_dialog" />