mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user