mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05: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:
parent
8409ebe4eb
commit
e0a0942015
7 changed files with 0 additions and 42 deletions
|
@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.material.icons.Icons
|
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.History
|
||||||
import androidx.compose.material.icons.outlined.Settings
|
import androidx.compose.material.icons.outlined.Settings
|
||||||
import androidx.compose.material3.AlertDialog
|
import androidx.compose.material3.AlertDialog
|
||||||
|
@ -67,7 +66,6 @@ fun ExtensionDetailsScreen(
|
||||||
state: ExtensionDetailsScreenModel.State,
|
state: ExtensionDetailsScreenModel.State,
|
||||||
onClickSourcePreferences: (sourceId: Long) -> Unit,
|
onClickSourcePreferences: (sourceId: Long) -> Unit,
|
||||||
onClickWhatsNew: () -> Unit,
|
onClickWhatsNew: () -> Unit,
|
||||||
onClickReadme: () -> Unit,
|
|
||||||
onClickEnableAll: () -> Unit,
|
onClickEnableAll: () -> Unit,
|
||||||
onClickDisableAll: () -> Unit,
|
onClickDisableAll: () -> Unit,
|
||||||
onClickClearCookies: () -> Unit,
|
onClickClearCookies: () -> Unit,
|
||||||
|
@ -91,13 +89,6 @@ fun ExtensionDetailsScreen(
|
||||||
onClick = onClickWhatsNew,
|
onClick = onClickWhatsNew,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
add(
|
|
||||||
AppBar.Action(
|
|
||||||
title = stringResource(MR.strings.action_faq_and_guides),
|
|
||||||
icon = Icons.AutoMirrored.Outlined.HelpOutline,
|
|
||||||
onClick = onClickReadme,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
addAll(
|
addAll(
|
||||||
listOf(
|
listOf(
|
||||||
|
|
|
@ -126,8 +126,6 @@ internal class ExtensionGithubApi {
|
||||||
libVersion = it.extractLibVersion(),
|
libVersion = it.extractLibVersion(),
|
||||||
lang = it.lang,
|
lang = it.lang,
|
||||||
isNsfw = it.nsfw == 1,
|
isNsfw = it.nsfw == 1,
|
||||||
hasReadme = it.hasReadme == 1,
|
|
||||||
hasChangelog = it.hasChangelog == 1,
|
|
||||||
sources = it.sources?.map(extensionSourceMapper).orEmpty(),
|
sources = it.sources?.map(extensionSourceMapper).orEmpty(),
|
||||||
apkName = it.apk,
|
apkName = it.apk,
|
||||||
iconUrl = "${getUrlPrefix()}icon/${it.pkg}.png",
|
iconUrl = "${getUrlPrefix()}icon/${it.pkg}.png",
|
||||||
|
@ -164,8 +162,6 @@ private data class ExtensionJsonObject(
|
||||||
val code: Long,
|
val code: Long,
|
||||||
val version: String,
|
val version: String,
|
||||||
val nsfw: Int,
|
val nsfw: Int,
|
||||||
val hasReadme: Int = 0,
|
|
||||||
val hasChangelog: Int = 0,
|
|
||||||
val sources: List<ExtensionSourceJsonObject>?,
|
val sources: List<ExtensionSourceJsonObject>?,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@ sealed class Extension {
|
||||||
abstract val libVersion: Double
|
abstract val libVersion: Double
|
||||||
abstract val lang: String?
|
abstract val lang: String?
|
||||||
abstract val isNsfw: Boolean
|
abstract val isNsfw: Boolean
|
||||||
abstract val hasReadme: Boolean
|
|
||||||
abstract val hasChangelog: Boolean
|
|
||||||
|
|
||||||
data class Installed(
|
data class Installed(
|
||||||
override val name: String,
|
override val name: String,
|
||||||
|
@ -24,8 +22,6 @@ sealed class Extension {
|
||||||
override val libVersion: Double,
|
override val libVersion: Double,
|
||||||
override val lang: String,
|
override val lang: String,
|
||||||
override val isNsfw: Boolean,
|
override val isNsfw: Boolean,
|
||||||
override val hasReadme: Boolean,
|
|
||||||
override val hasChangelog: Boolean,
|
|
||||||
val pkgFactory: String?,
|
val pkgFactory: String?,
|
||||||
val sources: List<Source>,
|
val sources: List<Source>,
|
||||||
val icon: Drawable?,
|
val icon: Drawable?,
|
||||||
|
@ -43,8 +39,6 @@ sealed class Extension {
|
||||||
override val libVersion: Double,
|
override val libVersion: Double,
|
||||||
override val lang: String,
|
override val lang: String,
|
||||||
override val isNsfw: Boolean,
|
override val isNsfw: Boolean,
|
||||||
override val hasReadme: Boolean,
|
|
||||||
override val hasChangelog: Boolean,
|
|
||||||
val sources: List<Source>,
|
val sources: List<Source>,
|
||||||
val apkName: String,
|
val apkName: String,
|
||||||
val iconUrl: String,
|
val iconUrl: String,
|
||||||
|
@ -75,7 +69,5 @@ sealed class Extension {
|
||||||
val signatureHash: String,
|
val signatureHash: String,
|
||||||
override val lang: String? = null,
|
override val lang: String? = null,
|
||||||
override val isNsfw: Boolean = false,
|
override val isNsfw: Boolean = false,
|
||||||
override val hasReadme: Boolean = false,
|
|
||||||
override val hasChangelog: Boolean = false,
|
|
||||||
) : Extension()
|
) : Extension()
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,8 +331,6 @@ internal object ExtensionLoader {
|
||||||
libVersion = libVersion,
|
libVersion = libVersion,
|
||||||
lang = lang,
|
lang = lang,
|
||||||
isNsfw = isNsfw,
|
isNsfw = isNsfw,
|
||||||
hasReadme = hasReadme,
|
|
||||||
hasChangelog = hasChangelog,
|
|
||||||
sources = sources,
|
sources = sources,
|
||||||
pkgFactory = appInfo.metaData.getString(METADATA_SOURCE_FACTORY),
|
pkgFactory = appInfo.metaData.getString(METADATA_SOURCE_FACTORY),
|
||||||
isUnofficial = !isOfficiallySigned(signatures),
|
isUnofficial = !isOfficiallySigned(signatures),
|
||||||
|
|
|
@ -37,7 +37,6 @@ data class ExtensionDetailsScreen(
|
||||||
state = state,
|
state = state,
|
||||||
onClickSourcePreferences = { navigator.push(SourcePreferencesScreen(it)) },
|
onClickSourcePreferences = { navigator.push(SourcePreferencesScreen(it)) },
|
||||||
onClickWhatsNew = { uriHandler.openUri(screenModel.getChangelogUrl()) },
|
onClickWhatsNew = { uriHandler.openUri(screenModel.getChangelogUrl()) },
|
||||||
onClickReadme = { uriHandler.openUri(screenModel.getReadmeUrl()) },
|
|
||||||
onClickEnableAll = { screenModel.toggleSources(true) },
|
onClickEnableAll = { screenModel.toggleSources(true) },
|
||||||
onClickDisableAll = { screenModel.toggleSources(false) },
|
onClickDisableAll = { screenModel.toggleSources(false) },
|
||||||
onClickClearCookies = screenModel::clearCookies,
|
onClickClearCookies = screenModel::clearCookies,
|
||||||
|
|
|
@ -31,8 +31,6 @@ import uy.kohesive.injekt.api.get
|
||||||
|
|
||||||
private const val URL_EXTENSION_COMMITS =
|
private const val URL_EXTENSION_COMMITS =
|
||||||
"https://github.com/tachiyomiorg/tachiyomi-extensions/commits/master"
|
"https://github.com/tachiyomiorg/tachiyomi-extensions/commits/master"
|
||||||
private const val URL_EXTENSION_BLOB =
|
|
||||||
"https://github.com/tachiyomiorg/tachiyomi-extensions/blob/master"
|
|
||||||
|
|
||||||
class ExtensionDetailsScreenModel(
|
class ExtensionDetailsScreenModel(
|
||||||
pkgName: String,
|
pkgName: String,
|
||||||
|
@ -93,26 +91,11 @@ class ExtensionDetailsScreenModel(
|
||||||
|
|
||||||
val pkgName = extension.pkgName.substringAfter("eu.kanade.tachiyomi.extension.")
|
val pkgName = extension.pkgName.substringAfter("eu.kanade.tachiyomi.extension.")
|
||||||
val pkgFactory = extension.pkgFactory
|
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
|
// Falling back on GitHub commit history because there is no explicit changelog in extension
|
||||||
return createUrl(URL_EXTENSION_COMMITS, pkgName, pkgFactory)
|
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() {
|
fun clearCookies() {
|
||||||
val extension = state.value.extension ?: return
|
val extension = state.value.extension ?: return
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,6 @@
|
||||||
<string name="action_webview_forward">Forward</string>
|
<string name="action_webview_forward">Forward</string>
|
||||||
<string name="action_webview_refresh">Refresh</string>
|
<string name="action_webview_refresh">Refresh</string>
|
||||||
<string name="action_start_downloading_now">Start downloading now</string>
|
<string name="action_start_downloading_now">Start downloading now</string>
|
||||||
<string name="action_faq_and_guides">FAQ and Guides</string>
|
|
||||||
<string name="action_not_now">Not now</string>
|
<string name="action_not_now">Not now</string>
|
||||||
|
|
||||||
<!-- Operations -->
|
<!-- Operations -->
|
||||||
|
|
Loading…
Reference in a new issue