mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Fix Links to Changelog/Readme/Commits for multisrc
(#7252)
* Fix Links to Changelog/Readme/Commits for `multisrc`
working basic fix. Needs to be refactored into `createUrl()`
* Refactor back into `createUrl`
hopefully the logic is understandable
there's three cases:
- when multisrc, if `path` isn't mentioned, then we're trying to open
commmit history
- when multisrc, if `path` is mentioned, then its either a changelog or
a readme to a multisrc extension, the files are stored in the
`overrides` subfolder
- when not multisrc, we're looking at a single source where the links
are constructed in the same way regardless of it being
changelog/readme/commit history
(cherry picked from commit e7695aef78
)
This commit is contained in:
parent
b635789740
commit
f461c71625
1 changed files with 7 additions and 3 deletions
|
@ -247,9 +247,13 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createUrl(url: String, pkgName: String, pkgFactory: String?, path: String = ""): String {
|
private fun createUrl(url: String, pkgName: String, pkgFactory: String?, path: String = ""): String {
|
||||||
return when {
|
return if (!pkgFactory.isNullOrEmpty()) {
|
||||||
!pkgFactory.isNullOrEmpty() -> "$url/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/$pkgFactory$path"
|
when (path.isEmpty()) {
|
||||||
else -> "$url/src/${pkgName.replace(".", "/")}$path"
|
true -> "$url/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/$pkgFactory"
|
||||||
|
else -> "$url/multisrc/overrides/$pkgFactory/" + (pkgName.split(".").lastOrNull() ?: "") + path
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
url + "/src/" + pkgName.replace(".", "/") + path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue