From 518f702bcacb0475c1b6dde6ec0ce2eb8b7ee734 Mon Sep 17 00:00:00 2001 From: AXIS5hacker <73385895+AXIS5hacker@users.noreply.github.com> Date: Mon, 25 May 2026 17:40:45 +0800 Subject: [PATCH 1/8] Update Gradle action in workflow configuration Signed-off-by: AXIS5hacker <73385895+AXIS5hacker@users.noreply.github.com> --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7d2a6cb..2ca3654 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,7 +22,7 @@ jobs: java-version: '11' distribution: 'temurin' - name: Build with Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v6 with: arguments: build -x test - name: Upload Artifacts From 964ff621862f945472067c50f90e5749ca3695b5 Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Mon, 25 May 2026 17:51:16 +0800 Subject: [PATCH 2/8] update workflow --- .github/workflows/gradle.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2ca3654..8bf1867 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -2,9 +2,9 @@ name: Explode Build Test on: push: - branches: [ "master" ] + branches: [ "v3" ] pull_request: - branches: [ "master" ] + branches: [ "v3" ] permissions: contents: read @@ -15,18 +15,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'temurin' - - name: Build with Gradle + - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - with: - arguments: build -x test + - name: Build with Gradle + run: ./gradlew build -x test - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Explode path: | From 8367a6fce2c553d40ac99d048a5ee6137d5bd62e Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Tue, 2 Jun 2026 02:02:45 +0800 Subject: [PATCH 3/8] Added new sort option and fixed a bug in ranking list refreshing --- .../main/kotlin/explode2/booster/graphql/BasicMaze.kt | 6 ++++++ .../explode2/booster/graphql/RefreshingRankingList.kt | 6 ++++-- gateau/src/main/kotlin/explode2/gateau/SongState.kt | 1 + .../kotlin/explode2/labyrinth/mongo/LabyrinthMongo.kt | 9 +++++++-- .../src/main/kotlin/explode2/labyrinth/SearchEnums.kt | 4 +++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/booster/src/main/kotlin/explode2/booster/graphql/BasicMaze.kt b/booster/src/main/kotlin/explode2/booster/graphql/BasicMaze.kt index 7de26fe..c6e4e7b 100644 --- a/booster/src/main/kotlin/explode2/booster/graphql/BasicMaze.kt +++ b/booster/src/main/kotlin/explode2/booster/graphql/BasicMaze.kt @@ -219,6 +219,7 @@ object BasicMaze : ExplodeQuery, ExplodeMutation, MazeProvider { val u = env.getUser() + // category mapping val cate = when { isHidden == 1 -> SearchCategory.HIDDEN isOfficial == 1 -> SearchCategory.OFFICIAL @@ -226,12 +227,17 @@ object BasicMaze : ExplodeQuery, ExplodeMutation, MazeProvider { isRanked == -1 -> SearchCategory.UNRANKED else -> SearchCategory.ALL } + + // sort type mapping + // see ExplodeX/labyrinth/src/main/kotlin/explode2/labyrinth/SearchEnums.kt for details val sort = when { playCountOrder == -1 -> SearchSort.DESCENDING_BY_PLAY_COUNT publishTimeOrder == -1 -> SearchSort.DESCENDING_BY_PUBLISH_TIME + publishTimeOrder == 1 -> SearchSort.ASCENDING_BY_PUBLISH_TIME else -> boom("invalid ordering") } + // return result return songRepo.searchSongSets( musicTitle, cate, diff --git a/booster/src/main/kotlin/explode2/booster/graphql/RefreshingRankingList.kt b/booster/src/main/kotlin/explode2/booster/graphql/RefreshingRankingList.kt index f62b16a..af6592e 100644 --- a/booster/src/main/kotlin/explode2/booster/graphql/RefreshingRankingList.kt +++ b/booster/src/main/kotlin/explode2/booster/graphql/RefreshingRankingList.kt @@ -26,11 +26,12 @@ data class RefreshingRankingList( lastUpdateTime = LocalDateTime.now() } + // fix hardcoded 24 hours refreshing fun get(): List { val lastUpdateTime = lastUpdateTime if( lastUpdateTime == null || - lastUpdateTime + 24.hours.toJavaDuration() <= LocalDateTime.now() || + lastUpdateTime + expireHours.hours.toJavaDuration() <= LocalDateTime.now() || cache == null ) { update() @@ -45,11 +46,12 @@ data class RefreshingRankingList( return get().drop(skip).take(limit) } + // fix hardcoded 24 hours refreshing fun get(playerId: String): PlayRecordWithRankModel? { val lastUpdateTime = lastUpdateTime if( lastUpdateTime == null || - lastUpdateTime + 24.hours.toJavaDuration() <= LocalDateTime.now() || + lastUpdateTime + expireHours.hours.toJavaDuration() <= LocalDateTime.now() || cache == null ) { update() diff --git a/gateau/src/main/kotlin/explode2/gateau/SongState.kt b/gateau/src/main/kotlin/explode2/gateau/SongState.kt index a33bc55..33224bf 100644 --- a/gateau/src/main/kotlin/explode2/gateau/SongState.kt +++ b/gateau/src/main/kotlin/explode2/gateau/SongState.kt @@ -18,6 +18,7 @@ interface SongState { fun ranked() = apply { category = Ranked } fun official() = apply { category = Official } + // how to parse the category field in database companion object { const val UnRanked = 0 const val Ranked = 1 diff --git a/labyrinth-mongodb/src/main/kotlin/explode2/labyrinth/mongo/LabyrinthMongo.kt b/labyrinth-mongodb/src/main/kotlin/explode2/labyrinth/mongo/LabyrinthMongo.kt index 7593ef2..3d3e245 100644 --- a/labyrinth-mongodb/src/main/kotlin/explode2/labyrinth/mongo/LabyrinthMongo.kt +++ b/labyrinth-mongodb/src/main/kotlin/explode2/labyrinth/mongo/LabyrinthMongo.kt @@ -244,10 +244,15 @@ class MongoManager(private val provider: LabyrinthMongoBuilder = LabyrinthMongoB // 排序顺序 when(sortBy) { - null, SearchSort.DESCENDING_BY_PUBLISH_TIME -> { + null, + // Descending by time + SearchSort.DESCENDING_BY_PUBLISH_TIME -> { pipeline += sort(descending(MongoSongSet::publishTime, MongoSongSet::musicName, MongoSongSet::id)) } - + // Ascending by time (Updated 2026.6.2) + SearchSort.ASCENDING_BY_PUBLISH_TIME -> { + pipeline += sort(ascending(MongoSongSet::publishTime, MongoSongSet::musicName, MongoSongSet::id)) + } // FIXME: 修复性能问题 SearchSort.DESCENDING_BY_PLAY_COUNT -> { // 添加游玩次数查询 diff --git a/labyrinth/src/main/kotlin/explode2/labyrinth/SearchEnums.kt b/labyrinth/src/main/kotlin/explode2/labyrinth/SearchEnums.kt index ebe1c0d..ab05f83 100644 --- a/labyrinth/src/main/kotlin/explode2/labyrinth/SearchEnums.kt +++ b/labyrinth/src/main/kotlin/explode2/labyrinth/SearchEnums.kt @@ -4,7 +4,9 @@ enum class SearchCategory { HIDDEN, OFFICIAL, RANKED, UNRANKED, REVIEW, ALL } +// Update 2026.6.2: added ASCENDING_BY_PUBLISH_TIME enum class SearchSort { DESCENDING_BY_PLAY_COUNT, - DESCENDING_BY_PUBLISH_TIME + DESCENDING_BY_PUBLISH_TIME, + ASCENDING_BY_PUBLISH_TIME } \ No newline at end of file From c8a7f741b9bca33e4e0cd7c337a567396a482975 Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Tue, 2 Jun 2026 02:13:11 +0800 Subject: [PATCH 4/8] error fix --- booster/src/main/kotlin/goodbird/GoodBirdOracle.kt | 1 + settings.gradle.kts | 2 +- src/main/kotlin/explode2/tests/Main.kt | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/booster/src/main/kotlin/goodbird/GoodBirdOracle.kt b/booster/src/main/kotlin/goodbird/GoodBirdOracle.kt index 2cbd8fd..47bf9e0 100644 --- a/booster/src/main/kotlin/goodbird/GoodBirdOracle.kt +++ b/booster/src/main/kotlin/goodbird/GoodBirdOracle.kt @@ -6,6 +6,7 @@ import kotlin.math.pow * 来自某位 `一般路过鸟` 的神谕。 * * 我们只需要铭记这位好鸟,不必知晓他的真实身份。如果你知道,也请你保密。 + * i.e. the R calculation logic */ object GoodBirdOracle { diff --git a/settings.gradle.kts b/settings.gradle.kts index 0321d48..03bbbc4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,7 +5,7 @@ include("labyrinth") include("labyrinth-mongodb") include("booster") include("resource") -include("booster-maintain") +includePlugin("maintain") // booster-plugins/maintain -> :maintain include("gatekeeper") include("explode-all") include("explode-proxy") diff --git a/src/main/kotlin/explode2/tests/Main.kt b/src/main/kotlin/explode2/tests/Main.kt index 313e11f..d4992ab 100644 --- a/src/main/kotlin/explode2/tests/Main.kt +++ b/src/main/kotlin/explode2/tests/Main.kt @@ -28,7 +28,7 @@ fun main(skip: Int = 0, limit: Int = 9) { val matchingName = "" val matchingCategory = SearchCategory.ALL - val sortBy = SearchSort.DESCENDING_BY_PUBLISH_TIME + val sortBy = SearchSort.ASCENDING_BY_PUBLISH_TIME class SongSetWithCharts(val charts: List) class SongSetWithPlayCount(val playCount: Int) @@ -176,6 +176,10 @@ fun main(skip: Int = 0, limit: Int = 9) { pipeline += sort(descending(MongoSongSet::publishTime, MongoSongSet::musicName, MongoSongSet::id)) } + SearchSort.ASCENDING_BY_PUBLISH_TIME -> { + pipeline += sort(ascending(MongoSongSet::publishTime, MongoSongSet::musicName, MongoSongSet::id)) + } + // FIXME: 修复性能问题 SearchSort.DESCENDING_BY_PLAY_COUNT -> { // 添加游玩次数查询 From 575abf867a0b8585705f32c0c35ece2b7dcf77a7 Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Tue, 2 Jun 2026 02:58:31 +0800 Subject: [PATCH 5/8] artifact version bump expv3 --- explode-all/build.gradle.kts | 3 ++- explode-proxy/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/explode-all/build.gradle.kts b/explode-all/build.gradle.kts index c08fd4e..f0930bb 100644 --- a/explode-all/build.gradle.kts +++ b/explode-all/build.gradle.kts @@ -4,8 +4,9 @@ plugins { id("com.github.johnrengelman.shadow") version "7.1.2" } +// It's explode v3 now group = "explode" -version = "1.0" +version = "3.0.3" repositories { mavenCentral() diff --git a/explode-proxy/build.gradle.kts b/explode-proxy/build.gradle.kts index 45bbf5c..c69fd46 100644 --- a/explode-proxy/build.gradle.kts +++ b/explode-proxy/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "explode" -version = "1.0" +version = "3.0.3" repositories { mavenCentral() diff --git a/settings.gradle.kts b/settings.gradle.kts index 03bbbc4..e9087a7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,7 +5,7 @@ include("labyrinth") include("labyrinth-mongodb") include("booster") include("resource") -includePlugin("maintain") // booster-plugins/maintain -> :maintain +// includePlugin("maintain") // useless include("gatekeeper") include("explode-all") include("explode-proxy") From b72b2ac9037c911132ad86338b65b678865cd5f4 Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Tue, 2 Jun 2026 03:38:59 +0800 Subject: [PATCH 6/8] =?UTF-8?q?+=E6=B0=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEV_README.md | 9 +++++++++ README.md | 2 ++ booster/src/main/kotlin/explode2/booster/MainLogics.kt | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/DEV_README.md b/DEV_README.md index e454391..05f081a 100644 --- a/DEV_README.md +++ b/DEV_README.md @@ -14,3 +14,12 @@ ### 数据提供 Labyrinth +## Artifacts + +The final JARs you can get from this project are: + - explode-all-.jar + - explode-all--all.jar + - explode-proxy-.jar + - explode-proxy--all.jar + +For server deploying, use explode-all--all.jar, and run it with `java -cp explode-all--ALL.jar explode2.booster.BoosterMainKt` diff --git a/README.md b/README.md index 1b70f9e..78948ce 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Or join our [Discord](https://discord.gg/BS5UZnsvVZ) server for English support. There is no well-documented code nor a helpful documentation to set up and use, so you need to figure it out by yourself or simply contact the contributors for help. +Maybe you can refer to DEV_README.md? + ### Env Vars *DB_URL*: The connection string to the database. \ No newline at end of file diff --git a/booster/src/main/kotlin/explode2/booster/MainLogics.kt b/booster/src/main/kotlin/explode2/booster/MainLogics.kt index 6adc8ec..9470328 100644 --- a/booster/src/main/kotlin/explode2/booster/MainLogics.kt +++ b/booster/src/main/kotlin/explode2/booster/MainLogics.kt @@ -31,7 +31,7 @@ object MainLogics : KoinComponent { // output Maze provider info gqlLogger.info("Using Maze: ${Colors.TianYi}${MazeProvider.getProvider().javaClass.canonicalName}") - val welcome = listOf("❄", "❤", "\uD83D\uDCE2", "\uD83D\uDCE3") + val welcome = listOf("❄", "❤", "\uD83D\uDCE2", "\uD83D\uDCE3", "氦") val playground = Application::class.java.classLoader.getResource("graphql-playground/index.html")?.readText() ?.replace( "\$BACKEND_URL\$", From 1e5d83d542968d315b4fc30d77035ed836b49773 Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Tue, 2 Jun 2026 04:17:02 +0800 Subject: [PATCH 7/8] hopefully it will pass the codacy check --- DEV_README.md | 12 +++++++----- gateau/src/main/kotlin/explode2/gateau/SongState.kt | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DEV_README.md b/DEV_README.md index 05f081a..73a06fa 100644 --- a/DEV_README.md +++ b/DEV_README.md @@ -17,9 +17,11 @@ ## Artifacts The final JARs you can get from this project are: - - explode-all-.jar - - explode-all--all.jar - - explode-proxy-.jar - - explode-proxy--all.jar -For server deploying, use explode-all--all.jar, and run it with `java -cp explode-all--ALL.jar explode2.booster.BoosterMainKt` +- explode-all-(version).jar +- explode-all-(version)-all.jar +- explode-proxy-(version).jar +- explode-proxy-(version)-all.jar + +For server deploying, use explode-all-(version)-all.jar, and run it with + `java -cp explode-all-(version)-ALL.jar explode2.booster.BoosterMainKt` diff --git a/gateau/src/main/kotlin/explode2/gateau/SongState.kt b/gateau/src/main/kotlin/explode2/gateau/SongState.kt index 33224bf..f6cf15e 100644 --- a/gateau/src/main/kotlin/explode2/gateau/SongState.kt +++ b/gateau/src/main/kotlin/explode2/gateau/SongState.kt @@ -2,6 +2,7 @@ package explode2.gateau +/* The interface of how we parse the set entries of the database.*/ interface SongState { var category: Int From e793086e4bd0df7f72b8d9a631d6f1ad9940fd00 Mon Sep 17 00:00:00 2001 From: AXIS5hacker Date: Tue, 2 Jun 2026 04:20:48 +0800 Subject: [PATCH 8/8] update remark --- gateau/src/main/kotlin/explode2/gateau/SongState.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gateau/src/main/kotlin/explode2/gateau/SongState.kt b/gateau/src/main/kotlin/explode2/gateau/SongState.kt index f6cf15e..24d199b 100644 --- a/gateau/src/main/kotlin/explode2/gateau/SongState.kt +++ b/gateau/src/main/kotlin/explode2/gateau/SongState.kt @@ -2,7 +2,7 @@ package explode2.gateau -/* The interface of how we parse the set entries of the database.*/ +/* The interface of how we parse the set entries of the database. */ interface SongState { var category: Int @@ -19,7 +19,6 @@ interface SongState { fun ranked() = apply { category = Ranked } fun official() = apply { category = Official } - // how to parse the category field in database companion object { const val UnRanked = 0 const val Ranked = 1