更新链接这一块

This commit is contained in:
HapeLee
2026-05-10 14:11:41 +08:00
parent 91b9aa5088
commit 15a931733a
@@ -24,9 +24,9 @@ object AppUpdateGitHub : AppUpdate.AppUpdateInterface {
private suspend fun getLatestRelease(): List<AppReleaseInfo> { private suspend fun getLatestRelease(): List<AppReleaseInfo> {
val url = if (checkVariant == AppVariant.OFFICIAL) val url = if (checkVariant == AppVariant.OFFICIAL)
"https://api.github.com/repos/325506/legado-with-MD3-DIY/releases/latest" "https://api.github.com/repos/HapeLee/legado-with-MD3/releases/latest"
else else
"https://api.github.com/repos/325506/legado-with-MD3-DIY/releases" "https://api.github.com/repos/HapeLee/legado-with-MD3/releases"
val res = okHttpClient.newCallResponse { url(url) } val res = okHttpClient.newCallResponse { url(url) }
if (!res.isSuccessful) throw NoStackTraceException("获取新版本出错(${res.code})") if (!res.isSuccessful) throw NoStackTraceException("获取新版本出错(${res.code})")
@@ -65,7 +65,7 @@ object AppUpdateGitHub : AppUpdate.AppUpdateInterface {
} }
suspend fun getReleaseByTag(tag: String): AppUpdate.UpdateInfo? { suspend fun getReleaseByTag(tag: String): AppUpdate.UpdateInfo? {
val url = "https://api.github.com/repos/325506/legado-with-MD3-DIY/releases/tags/$tag" val url = "https://api.github.com/repos/HapeLee/legado-with-MD3/releases/tags/$tag"
val res = okHttpClient.newCallResponse { url(url) } val res = okHttpClient.newCallResponse { url(url) }
if (!res.isSuccessful) return null if (!res.isSuccessful) return null
@@ -86,7 +86,7 @@ object AppUpdateGitHub : AppUpdate.AppUpdateInterface {
val currentVersion = AppConst.appInfo.versionName val currentVersion = AppConst.appInfo.versionName
val releases = getLatestRelease() val releases = getLatestRelease()
val filtered = if (checkVariant == AppVariant.ALL || checkVariant == AppVariant.UNKNOWN) { val filtered = if (checkVariant == AppVariant.ALL) {
releases releases
} else { } else {
releases.filter { it.appVariant == checkVariant } releases.filter { it.appVariant == checkVariant }