mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 04:29:18 +01:00
Fix extension installer running on loop when all updates for extensions are previously installed by app
This commit is contained in:
parent
9f31529870
commit
7dfbd6aab3
@ -109,7 +109,7 @@ class ExtensionInstallService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
job?.invokeOnCompletion {
|
job?.invokeOnCompletion {
|
||||||
if (showUpdatedNotification) {
|
if (showUpdatedNotification && installedExtensions.size > 0) {
|
||||||
notifier.showUpdatedNotification(installedExtensions, preferences.hideNotificationContent())
|
notifier.showUpdatedNotification(installedExtensions, preferences.hideNotificationContent())
|
||||||
}
|
}
|
||||||
if (reRunUpdateCheck || installedExtensions.size != list.size) {
|
if (reRunUpdateCheck || installedExtensions.size != list.size) {
|
||||||
|
@ -61,22 +61,24 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
|||||||
val extensionManager = Injekt.get<ExtensionManager>()
|
val extensionManager = Injekt.get<ExtensionManager>()
|
||||||
val extensionsInstalledByApp =
|
val extensionsInstalledByApp =
|
||||||
extensions.filter { extensionManager.isInstalledByApp(it) }
|
extensions.filter { extensionManager.isInstalledByApp(it) }
|
||||||
val intent =
|
if (extensionsInstalledByApp.isNotEmpty()) {
|
||||||
ExtensionInstallService.jobIntent(
|
val intent =
|
||||||
context,
|
ExtensionInstallService.jobIntent(
|
||||||
extensionsInstalledByApp,
|
context,
|
||||||
// Re reun this job if not all the extensions can be auto updated
|
extensionsInstalledByApp,
|
||||||
if (extensionsInstalledByApp.size == extensions.size) {
|
// Re run this job if not all the extensions can be auto updated
|
||||||
1
|
if (extensionsInstalledByApp.size == extensions.size) {
|
||||||
} else {
|
1
|
||||||
2
|
} else {
|
||||||
}
|
2
|
||||||
)
|
}
|
||||||
context.startForegroundService(intent)
|
)
|
||||||
if (extensionsInstalledByApp.size == extensions.size) {
|
context.startForegroundService(intent)
|
||||||
return
|
if (extensionsInstalledByApp.size == extensions.size) {
|
||||||
} else {
|
return
|
||||||
extensions.removeAll(extensionsInstalledByApp)
|
} else {
|
||||||
|
extensions.removeAll(extensionsInstalledByApp)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
runJobAgain(context, NetworkType.UNMETERED)
|
runJobAgain(context, NetworkType.UNMETERED)
|
||||||
|
Loading…
Reference in New Issue
Block a user