android: Sort recently added/played games by time

This commit is contained in:
t895 2024-01-20 03:18:48 -05:00
parent b4a8e1ef8a
commit dad48f16b7

View File

@ -136,14 +136,14 @@ class SearchFragment : Fragment() {
baseList.filter { baseList.filter {
val lastPlayedTime = preferences.getLong(it.keyLastPlayedTime, 0L) val lastPlayedTime = preferences.getLong(it.keyLastPlayedTime, 0L)
lastPlayedTime > (System.currentTimeMillis() - 24 * 60 * 60 * 1000) lastPlayedTime > (System.currentTimeMillis() - 24 * 60 * 60 * 1000)
} }.sortedByDescending { preferences.getLong(it.keyLastPlayedTime, 0L) }
} }
R.id.chip_recently_added -> { R.id.chip_recently_added -> {
baseList.filter { baseList.filter {
val addedTime = preferences.getLong(it.keyAddedToLibraryTime, 0L) val addedTime = preferences.getLong(it.keyAddedToLibraryTime, 0L)
addedTime > (System.currentTimeMillis() - 24 * 60 * 60 * 1000) addedTime > (System.currentTimeMillis() - 24 * 60 * 60 * 1000)
} }.sortedByDescending { preferences.getLong(it.keyAddedToLibraryTime, 0L) }
} }
R.id.chip_homebrew -> baseList.filter { it.isHomebrew } R.id.chip_homebrew -> baseList.filter { it.isHomebrew }