properly sort items at TracksActivity at initial loading too

This commit is contained in:
tibbi 2022-06-06 20:36:12 +02:00
parent 491efa549f
commit 12621e6d97

View file

@ -100,7 +100,11 @@ class TracksActivity : SimpleActivity() {
val playlistTracks = tracksDAO.getTracksFromPlaylist(playlist!!.id).map { track -> val playlistTracks = tracksDAO.getTracksFromPlaylist(playlist!!.id).map { track ->
track.title = track.getProperTitle(showFilename) track.title = track.getProperTitle(showFilename)
track track
} } as ArrayList<Track>
Track.sorting = config.playlistTracksSorting
playlistTracks.sort()
runOnUiThread { runOnUiThread {
tracks_placeholder.beVisibleIf(playlistTracks.isEmpty()) tracks_placeholder.beVisibleIf(playlistTracks.isEmpty())
tracks_placeholder_2.beVisibleIf(playlistTracks.isEmpty()) tracks_placeholder_2.beVisibleIf(playlistTracks.isEmpty())
@ -123,7 +127,11 @@ class TracksActivity : SimpleActivity() {
val folderTracks = tracksDAO.getTracksFromFolder(folder ?: "").map { track -> val folderTracks = tracksDAO.getTracksFromFolder(folder ?: "").map { track ->
track.title = track.getProperTitle(showFilename) track.title = track.getProperTitle(showFilename)
track track
} } as ArrayList<Track>
Track.sorting = config.playlistTracksSorting
folderTracks.sort()
runOnUiThread { runOnUiThread {
tracks_placeholder.beVisibleIf(folderTracks.isEmpty()) tracks_placeholder.beVisibleIf(folderTracks.isEmpty())
} }