Skip to content

Commit

Permalink
fix: the sort of modrinth projects is reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
SettingDust committed Oct 19, 2024
1 parent b0cab12 commit 6d7dbac
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/commonMain/kotlin/teksturepako/pakku/api/platforms/Modrinth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,16 @@ object Modrinth : Platform(
.awaitAll()
.flatten()
.filterFileModels(mcVersions, loadersWithType)
.sortedWith(compareBy({ Instant.parse(it.datePublished) }, { file ->
compareByLoaders(projectInfos[file.projectId]?.let {
if (it == ProjectType.DATA_PACK) listOf(DATAPACK_LOADER) else null
} ?: loaders)(file)
})
)
.sortedWith(
compareByDescending<MrVersionModel> { Instant.parse(it.datePublished) }
.thenBy { file ->
compareByLoaders(projectInfos[file.projectId]?.let {
if (it == ProjectType.DATA_PACK) listOf(
DATAPACK_LOADER
)
else null
} ?: loaders)(file)
})
.flatMap { version -> version.toProjectFiles() }
.toMutableSet()
}
Expand Down

0 comments on commit 6d7dbac

Please sign in to comment.