Fixed Album artist sort order in Albums tab

main
Prathamesh More 2021-12-01 18:05:16 +05:30
parent 12cf446375
commit fd639d6348
5 changed files with 8 additions and 7 deletions

View File

@ -163,7 +163,7 @@ open class AlbumAdapter(
when (PreferenceUtil.albumSortOrder) {
SortOrder.AlbumSortOrder.ALBUM_A_Z, SortOrder.AlbumSortOrder.ALBUM_Z_A -> sectionName =
dataSet[position].title
SortOrder.AlbumSortOrder.ALBUM_ARTIST -> sectionName = dataSet[position].artistName
SortOrder.AlbumSortOrder.ALBUM_ARTIST -> sectionName = dataSet[position].albumArtist
SortOrder.AlbumSortOrder.ALBUM_YEAR -> return MusicUtil.getYearString(
dataSet[position].year
)

View File

@ -196,7 +196,7 @@ class AlbumsFragment : AbsRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridL
0,
R.id.action_album_sort_order_artist,
2,
R.string.sort_order_artist
R.string.sort_order_album_artist
).isChecked =
currentSortOrder.equals(AlbumSortOrder.ALBUM_ARTIST)
sortOrderMenu.add(

View File

@ -54,11 +54,11 @@ class SortOrder {
const val ALBUM_Z_A = "$ALBUM_A_Z DESC"
/* Album sort order songs */
const val ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.AlbumColumns.NUMBER_OF_SONGS + " DESC"
const val ALBUM_NUMBER_OF_SONGS =
MediaStore.Audio.AlbumColumns.NUMBER_OF_SONGS + " DESC"
/* Album sort order artist */
const val ALBUM_ARTIST = (MediaStore.Audio.Artists.DEFAULT_SORT_ORDER +
", " + MediaStore.Audio.Albums.DEFAULT_SORT_ORDER)
/* Album Artist sort order artist */
const val ALBUM_ARTIST = "case when lower(album_artist) is null then 1 else 0 end, lower(album_artist)"
/* Album sort order year */
const val ALBUM_YEAR = MediaStore.Audio.Media.YEAR + " DESC"

View File

@ -241,7 +241,7 @@ object MusicUtil : KoinComponent {
var musicMediaTitle = mediaTitle
return try {
if (TextUtils.isEmpty(musicMediaTitle)) {
return ""
return "-"
}
musicMediaTitle = musicMediaTitle!!.trim { it <= ' ' }.lowercase()
if (musicMediaTitle.startsWith("the ")) {

View File

@ -454,6 +454,7 @@
<string name="sort_order_a_z">Ascending</string>
<string name="sort_order_album">Album</string>
<string name="sort_order_artist">Artist</string>
<string name="sort_order_album_artist">@string/album_artist</string>
<string name="sort_order_composer">Composer</string>
<string name="sort_order_date">Date added</string>
<string name="sort_order_date_modified">Date modified</string>