detail: fix crash on multi-artist navigation

Caused by an unimplemented navigation branch in ArtistDetailFragment.
This commit is contained in:
Alexander Capehart 2023-08-17 20:24:17 -06:00
parent 58989f8568
commit d297c10b0a
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
3 changed files with 14 additions and 3 deletions

View file

@ -221,8 +221,16 @@ class ArtistDetailFragment :
.navigateSafe(ArtistDetailFragmentDirections.showArtist(show.artist.uid))
}
}
is Show.SongArtistDecision,
is Show.AlbumArtistDecision,
is Show.SongArtistDecision -> {
logD("Navigating to artist choices for ${show.song}")
findNavController()
.navigateSafe(ArtistDetailFragmentDirections.showArtistChoices(show.song.uid))
}
is Show.AlbumArtistDecision -> {
logD("Navigating to artist choices for ${show.album}")
findNavController()
.navigateSafe(ArtistDetailFragmentDirections.showArtistChoices(show.album.uid))
}
is Show.GenreDetails,
is Show.PlaylistDetails -> {
error("Unexpected show command $show")

View file

@ -76,7 +76,7 @@ class AddToPlaylistDialog :
// --- VIEWMODEL SETUP ---
pickerModel.setSongsToAdd(args.songUids)
collect(musicModel.playlistDecision.flow, ::handleDecision)
musicModel.playlistDecision.consume()
collectImmediately(pickerModel.currentSongsToAdd, ::updatePendingSongs)
collectImmediately(pickerModel.playlistAddChoices, ::updatePlaylistChoices)
}

View file

@ -263,6 +263,9 @@
<action
android:id="@+id/show_artist"
app:destination="@id/artist_detail_fragment" />
<action
android:id="@+id/show_artist_choices"
app:destination="@id/show_artist_choices_dialog" />
<action
android:id="@+id/open_song_menu"
app:destination="@id/song_menu_dialog" />