cleanup PlayerFragment

This commit is contained in:
darthpaul
2022-04-17 17:09:29 +01:00
parent 1134819b25
commit ccc82c8605

View File

@@ -167,20 +167,24 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
} }
private fun getRecordings(): ArrayList<Recording> { private fun getRecordings(): ArrayList<Recording> {
val recordings = ArrayList<Recording>()
return when { return when {
isRPlus() -> { isRPlus() -> {
ArrayList(getMediaStoreRecordings() + getSAFRecordings()).apply { recordings.addAll(getMediaStoreRecordings())
sortByDescending { it.timestamp } recordings.addAll(getSAFRecordings())
} recordings
} }
isQPlus() -> { isQPlus() -> {
ArrayList(getMediaStoreRecordings() + getLegacyRecordings()).apply { recordings.addAll(getMediaStoreRecordings())
sortByDescending { it.timestamp } recordings.addAll(getLegacyRecordings())
} recordings
} }
else -> { else -> {
getLegacyRecordings() recordings.addAll(getLegacyRecordings())
recordings
} }
}.apply {
sortByDescending { it.timestamp }
} }
} }