mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 10:23:33 +00:00
feat: add preference to sort artists by album count
This commit is contained in:
parent
4c865e199d
commit
5d51132921
4 changed files with 24 additions and 1 deletions
|
|
@ -79,6 +79,7 @@ object Preferences {
|
|||
private const val ALBUM_DETAIL = "album_detail"
|
||||
private const val ALBUM_SORT_ORDER = "album_sort_order"
|
||||
private const val DEFAULT_ALBUM_SORT_ORDER = Constants.ALBUM_ORDER_BY_NAME
|
||||
private const val ARTIST_SORT_BY_ALBUM_COUNT= "artist_sort_by_album_count"
|
||||
|
||||
@JvmStatic
|
||||
fun getServer(): String? {
|
||||
|
|
@ -656,4 +657,14 @@ object Preferences {
|
|||
fun setAlbumSortOrder(sortOrder: String) {
|
||||
App.getInstance().preferences.edit().putString(ALBUM_SORT_ORDER, sortOrder).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getArtistSortOrder(): String {
|
||||
val sort_by_album_count = App.getInstance().preferences.getBoolean(ARTIST_SORT_BY_ALBUM_COUNT, false)
|
||||
Log.d("Preferences", "getSortOrder")
|
||||
if (sort_by_album_count)
|
||||
return Constants.ARTIST_ORDER_BY_ALBUM_COUNT
|
||||
else
|
||||
return Constants.ARTIST_ORDER_BY_NAME
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue