Handle link for multisource extension commits (closes #4432)

This commit is contained in:
arkon
2021-02-11 17:35:15 -05:00
parent 2a454b44cc
commit a398c3fb81
3 changed files with 11 additions and 2 deletions

View File

@@ -208,7 +208,11 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
private fun openCommitHistory() {
val pkgName = presenter.extension!!.pkgName.substringAfter("eu.kanade.tachiyomi.extension.")
val url = "https://github.com/tachiyomiorg/tachiyomi-extensions/commits/master/src/${pkgName.replace(".", "/")}"
val pkgFactory = presenter.extension!!.pkgFactory
val url = when {
!pkgFactory.isNullOrEmpty() -> "$URL_EXTENSION_COMMITS/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/$pkgFactory"
else -> "$URL_EXTENSION_COMMITS/src/${pkgName.replace(".", "/")}"
}
val intent = Intent(Intent.ACTION_VIEW, url.toUri())
startActivity(intent)
}
@@ -232,5 +236,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
private companion object {
const val PKGNAME_KEY = "pkg_name"
private const val URL_EXTENSION_COMMITS = "https://github.com/tachiyomiorg/tachiyomi-extensions/commits/master"
}
}