Skip to content

Commit

Permalink
detail: allow adding to playlist in playlist
Browse files Browse the repository at this point in the history
The playback view can still add to a playlist from a playlist, so I
have to implement this navigation route no matter what.
  • Loading branch information
OxygenCobalt committed Nov 12, 2023
1 parent a99b0ff commit 52697ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/navigation/inner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down

0 comments on commit 52697ef

Please sign in to comment.