fix: sorting by download type

This commit is contained in:
jraleman
2026-02-28 21:46:12 -05:00
parent 3d5b9a94fb
commit 837ee76bdc
@@ -263,8 +263,8 @@ class DownloadsFragment : MainFragment() {
"releasedDesc" -> vidsToReturn.sortedByDescending { it.datetime ?: OffsetDateTime.MIN } "releasedDesc" -> vidsToReturn.sortedByDescending { it.datetime ?: OffsetDateTime.MIN }
"sizeAsc" -> vidsToReturn.sortedBy { it.videoSource.sumOf { it.fileSize } + it.audioSource.sumOf { it.fileSize } } "sizeAsc" -> vidsToReturn.sortedBy { it.videoSource.sumOf { it.fileSize } + it.audioSource.sumOf { it.fileSize } }
"sizeDesc" -> vidsToReturn.sortedByDescending { it.videoSource.sumOf { it.fileSize } + it.audioSource.sumOf { it.fileSize } } "sizeDesc" -> vidsToReturn.sortedByDescending { it.videoSource.sumOf { it.fileSize } + it.audioSource.sumOf { it.fileSize } }
"typeAudio" -> vidsToReturn.filter { it.videoSource.isEmpty() && it.audioSource.isNotEmpty() } "typeAudio" -> vidsToReturn.sortedBy { if (it.videoSource.isEmpty() && it.audioSource.isNotEmpty()) 0 else 1 }
"typeVideo" -> vidsToReturn.filter { it.videoSource.isNotEmpty() } "typeVideo" -> vidsToReturn.sortedBy { if (it.videoSource.isNotEmpty()) 0 else 1 }
else -> vidsToReturn else -> vidsToReturn
} }
} }