From e0a0942015accc217a881739abf8df9d74eab6da Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 5 Jan 2024 17:07:49 -0500 Subject: [PATCH] Remove custom extension readme/changelog URLs These were barely used/maintained, so just killing them. Changelog menu item still exists to take you to the relevant git history. --- .../browse/ExtensionDetailsScreen.kt | 9 --------- .../extension/api/ExtensionGithubApi.kt | 4 ---- .../tachiyomi/extension/model/Extension.kt | 8 -------- .../tachiyomi/extension/util/ExtensionLoader.kt | 2 -- .../extension/details/ExtensionDetailsScreen.kt | 1 - .../details/ExtensionDetailsScreenModel.kt | 17 ----------------- .../commonMain/resources/MR/base/strings.xml | 1 - 7 files changed, 42 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt index 65da031422..5ab0159d7b 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt @@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.items import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.outlined.HelpOutline import androidx.compose.material.icons.outlined.History import androidx.compose.material.icons.outlined.Settings import androidx.compose.material3.AlertDialog @@ -67,7 +66,6 @@ fun ExtensionDetailsScreen( state: ExtensionDetailsScreenModel.State, onClickSourcePreferences: (sourceId: Long) -> Unit, onClickWhatsNew: () -> Unit, - onClickReadme: () -> Unit, onClickEnableAll: () -> Unit, onClickDisableAll: () -> Unit, onClickClearCookies: () -> Unit, @@ -91,13 +89,6 @@ fun ExtensionDetailsScreen( onClick = onClickWhatsNew, ), ) - add( - AppBar.Action( - title = stringResource(MR.strings.action_faq_and_guides), - icon = Icons.AutoMirrored.Outlined.HelpOutline, - onClick = onClickReadme, - ), - ) } addAll( listOf( diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index e9421fed97..3032aee03e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -126,8 +126,6 @@ internal class ExtensionGithubApi { libVersion = it.extractLibVersion(), lang = it.lang, isNsfw = it.nsfw == 1, - hasReadme = it.hasReadme == 1, - hasChangelog = it.hasChangelog == 1, sources = it.sources?.map(extensionSourceMapper).orEmpty(), apkName = it.apk, iconUrl = "${getUrlPrefix()}icon/${it.pkg}.png", @@ -164,8 +162,6 @@ private data class ExtensionJsonObject( val code: Long, val version: String, val nsfw: Int, - val hasReadme: Int = 0, - val hasChangelog: Int = 0, val sources: List?, ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/model/Extension.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/model/Extension.kt index e7eab29b61..7f4a316aa6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/model/Extension.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/model/Extension.kt @@ -13,8 +13,6 @@ sealed class Extension { abstract val libVersion: Double abstract val lang: String? abstract val isNsfw: Boolean - abstract val hasReadme: Boolean - abstract val hasChangelog: Boolean data class Installed( override val name: String, @@ -24,8 +22,6 @@ sealed class Extension { override val libVersion: Double, override val lang: String, override val isNsfw: Boolean, - override val hasReadme: Boolean, - override val hasChangelog: Boolean, val pkgFactory: String?, val sources: List, val icon: Drawable?, @@ -43,8 +39,6 @@ sealed class Extension { override val libVersion: Double, override val lang: String, override val isNsfw: Boolean, - override val hasReadme: Boolean, - override val hasChangelog: Boolean, val sources: List, val apkName: String, val iconUrl: String, @@ -75,7 +69,5 @@ sealed class Extension { val signatureHash: String, override val lang: String? = null, override val isNsfw: Boolean = false, - override val hasReadme: Boolean = false, - override val hasChangelog: Boolean = false, ) : Extension() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt index ecb4d09e2c..a01ee5cb45 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt @@ -331,8 +331,6 @@ internal object ExtensionLoader { libVersion = libVersion, lang = lang, isNsfw = isNsfw, - hasReadme = hasReadme, - hasChangelog = hasChangelog, sources = sources, pkgFactory = appInfo.metaData.getString(METADATA_SOURCE_FACTORY), isUnofficial = !isOfficiallySigned(signatures), diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreen.kt index 1797dc89d8..79af923284 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreen.kt @@ -37,7 +37,6 @@ data class ExtensionDetailsScreen( state = state, onClickSourcePreferences = { navigator.push(SourcePreferencesScreen(it)) }, onClickWhatsNew = { uriHandler.openUri(screenModel.getChangelogUrl()) }, - onClickReadme = { uriHandler.openUri(screenModel.getReadmeUrl()) }, onClickEnableAll = { screenModel.toggleSources(true) }, onClickDisableAll = { screenModel.toggleSources(false) }, onClickClearCookies = screenModel::clearCookies, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt index a0ed5495b9..c6e821bbd1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt @@ -31,8 +31,6 @@ import uy.kohesive.injekt.api.get private const val URL_EXTENSION_COMMITS = "https://github.com/tachiyomiorg/tachiyomi-extensions/commits/master" -private const val URL_EXTENSION_BLOB = - "https://github.com/tachiyomiorg/tachiyomi-extensions/blob/master" class ExtensionDetailsScreenModel( pkgName: String, @@ -93,26 +91,11 @@ class ExtensionDetailsScreenModel( val pkgName = extension.pkgName.substringAfter("eu.kanade.tachiyomi.extension.") val pkgFactory = extension.pkgFactory - if (extension.hasChangelog) { - return createUrl(URL_EXTENSION_BLOB, pkgName, pkgFactory, "/CHANGELOG.md") - } // Falling back on GitHub commit history because there is no explicit changelog in extension return createUrl(URL_EXTENSION_COMMITS, pkgName, pkgFactory) } - fun getReadmeUrl(): String { - val extension = state.value.extension ?: return "" - - if (!extension.hasReadme) { - return "https://tachiyomi.org/docs/faq/browse/extensions" - } - - val pkgName = extension.pkgName.substringAfter("eu.kanade.tachiyomi.extension.") - val pkgFactory = extension.pkgFactory - return createUrl(URL_EXTENSION_BLOB, pkgName, pkgFactory, "/README.md") - } - fun clearCookies() { val extension = state.value.extension ?: return diff --git a/i18n/src/commonMain/resources/MR/base/strings.xml b/i18n/src/commonMain/resources/MR/base/strings.xml index 4f899abbf2..e130180c12 100644 --- a/i18n/src/commonMain/resources/MR/base/strings.xml +++ b/i18n/src/commonMain/resources/MR/base/strings.xml @@ -163,7 +163,6 @@ Forward Refresh Start downloading now - FAQ and Guides Not now