fix: Extensions not retaining their repo url

This commit is contained in:
Ahmad Ansori Palembani 2024-06-09 11:36:14 +07:00
parent 44835ecb36
commit 6e1267d186
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
3 changed files with 14 additions and 2 deletions

View file

@ -23,6 +23,7 @@
- Improve download queue (AshbornXS)
- Download badge now show download queue count
- Add option to move series to bottom
- Only show "open repo url" button when repo url is not empty
## Fixes
- Fix potential crashes for some custom Android rom
@ -31,6 +32,7 @@
- Custom manga info now relink properly upon migration
- Fixed extension repo list did not update when a repo is added via deep link
- Fixed download unread trying to download filtered (by scanlator) chapters
- Fixed extensions not retaining their repo url
## Other
- Migrate `RawQueries#librayQuery` to use SQLDelight (`GetLibraryManga`), should improve stability

View file

@ -213,8 +213,12 @@ class ExtensionManager(
repoUrl = availableExt.repoUrl,
)
hasUpdateCount++
changed = true
} else {
mutInstalledExtensions[index] = installedExt.copy(
repoUrl = availableExt.repoUrl,
)
}
changed = true
}
}
if (changed) {

View file

@ -154,6 +154,12 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
inflater.inflate(R.menu.extension_details, menu)
}
override fun onPrepareOptionsMenu(menu: Menu) {
val item = menu.findItem(R.id.action_open_repo)
item.isVisible = presenter.extension?.repoUrl != null
super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_open_repo -> openRepo()
@ -163,7 +169,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
}
private fun openRepo() {
val url = getUrl(presenter.extension?.repoUrl)
val url = getUrl(presenter.extension?.repoUrl) ?: return
openInBrowser(url)
}