From 6fe5c1d6662bef332deb1f705bdcd63996229906 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:51:43 +0800 Subject: [PATCH] Use commit author name instead of login name Fix parse error caused by invalid GitHub account --- .../main/kotlin/com/hippo/ehviewer/updater/AppUpdater.kt | 2 +- app/src/main/kotlin/tachiyomi/data/release/GithubCommit.kt | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/updater/AppUpdater.kt b/app/src/main/kotlin/com/hippo/ehviewer/updater/AppUpdater.kt index 428034976..de769be5c 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/updater/AppUpdater.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/updater/AppUpdater.kt @@ -48,7 +48,7 @@ object AppUpdater { val result = ghStatement(commitComparisonUrl).executeAndParseAs() // TODO: Prettier format, Markdown? result.commits.joinToString("\n") { commit -> - "${commit.commit.message.takeWhile { it != '\n' }} (@${commit.author.name})" + "${commit.commit.message.takeWhile { it != '\n' }} (@${commit.commit.author.name})" } }.getOrDefault(workflowRun.title) return Release(shortSha, changelog, archiveUrl) diff --git a/app/src/main/kotlin/tachiyomi/data/release/GithubCommit.kt b/app/src/main/kotlin/tachiyomi/data/release/GithubCommit.kt index 49e40be8f..0f8ddb543 100644 --- a/app/src/main/kotlin/tachiyomi/data/release/GithubCommit.kt +++ b/app/src/main/kotlin/tachiyomi/data/release/GithubCommit.kt @@ -1,16 +1,15 @@ package tachiyomi.data.release -import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class GithubCommitComparison(val commits: List) @Serializable -data class GithubCommit(val commit: GithubCommitDetail, val author: GithubCommitAuthor) +data class GithubCommit(val commit: GithubCommitDetail) @Serializable -data class GithubCommitDetail(val message: String) +data class GithubCommitDetail(val author: GithubCommitAuthor, val message: String) @Serializable -data class GithubCommitAuthor(@SerialName("login") val name: String) +data class GithubCommitAuthor(val name: String)