Fixed Top/Recent Artists/Albums order
This commit is contained in:
parent
6779eb0e2b
commit
197e7ff085
3 changed files with 5 additions and 3 deletions
|
@ -72,9 +72,11 @@ class RealAlbumRepository(private val songRepository: RealSongRepository) :
|
|||
// We don't need sorted list of songs (with sortAlbumSongs())
|
||||
// cuz we are just displaying Albums(Cover Arts) anyway and not songs
|
||||
fun splitIntoAlbums(
|
||||
songs: List<Song>
|
||||
songs: List<Song>,
|
||||
sorted: Boolean = true
|
||||
): List<Album> {
|
||||
val grouped = songs.groupBy { it.albumId }.map { Album(it.key, it.value) }
|
||||
if (!sorted) return grouped
|
||||
val collator = Collator.getInstance()
|
||||
return when (PreferenceUtil.albumSortOrder) {
|
||||
SortOrder.AlbumSortOrder.ALBUM_A_Z -> {
|
||||
|
|
|
@ -42,7 +42,7 @@ class RealLastAddedRepository(
|
|||
}
|
||||
|
||||
override fun recentAlbums(): List<Album> {
|
||||
return albumRepository.splitIntoAlbums(recentSongs())
|
||||
return albumRepository.splitIntoAlbums(recentSongs(), sorted = false)
|
||||
}
|
||||
|
||||
override fun recentArtists(): List<Artist> {
|
||||
|
|
|
@ -81,7 +81,7 @@ class RealTopPlayedRepository(
|
|||
}
|
||||
|
||||
override fun topAlbums(): List<Album> {
|
||||
return albumRepository.splitIntoAlbums(topTracks())
|
||||
return albumRepository.splitIntoAlbums(topTracks(), sorted = false)
|
||||
}
|
||||
|
||||
override fun topArtists(): List<Artist> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue