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

View file

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

View file

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