Exit Artist & Album details if song count is 0, in case Songs may have got deleted for those Album or Artist

This commit is contained in:
Prathamesh More 2021-12-28 13:31:27 +05:30
parent dff682c1f1
commit 91baedfc70
2 changed files with 5 additions and 0 deletions

View file

@ -206,6 +206,7 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
private fun showAlbum(album: Album) {
if (album.songs.isEmpty()) {
findNavController().navigateUp()
return
}
this.album = album

View file

@ -141,6 +141,10 @@ abstract class AbsArtistDetailsFragment : AbsMainActivityFragment(R.layout.fragm
}
private fun showArtist(artist: Artist) {
if (artist.songCount == 0) {
findNavController().navigateUp()
return
}
this.artist = artist
loadArtistImage(artist)
if (RetroUtil.isAllowedToDownloadMetadata(requireContext())) {