[Playlists] Filtering Empty playlists e.g. Favorites

This commit is contained in:
Prathamesh More 2021-11-28 18:48:20 +05:30
parent a78100c0ea
commit ca9c3124f1

View file

@ -42,7 +42,7 @@ class PlaylistsFragment :
super.onViewCreated(view, savedInstanceState)
libraryViewModel.getPlaylists().observe(viewLifecycleOwner, {
if (it.isNotEmpty())
adapter?.swapDataSet(it)
adapter?.swapDataSet(it.filter { playlistWithSongs-> playlistWithSongs.songs.isNotEmpty() })
else
adapter?.swapDataSet(listOf())
})