lets show empty playlists too

This commit is contained in:
tibbi 2020-10-25 09:55:20 +01:00
parent f1db48ed88
commit 8450ca52d6

View file

@ -25,11 +25,11 @@ class PlaylistsFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
override fun setupFragment(activity: SimpleActivity) {
ensureBackgroundThread {
var playlists = activity.playlistDAO.getAll() as ArrayList<Playlist>
val playlists = activity.playlistDAO.getAll() as ArrayList<Playlist>
playlists.forEach {
it.trackCnt = activity.tracksDAO.getTracksCountFromPlaylist(it.id)
}
playlists = playlists.filter { it.trackCnt != 0 }.toMutableList() as ArrayList<Playlist>
Playlist.sorting = activity.config.playlistSorting
playlists.sort()