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 {
|
||||
if (showUpdatedNotification) {
|
||||
if (showUpdatedNotification && installedExtensions.size > 0) {
|
||||
notifier.showUpdatedNotification(installedExtensions, preferences.hideNotificationContent())
|
||||
}
|
||||
if (reRunUpdateCheck || installedExtensions.size != list.size) {
|
||||
|
@ -61,22 +61,24 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
||||
val extensionManager = Injekt.get<ExtensionManager>()
|
||||
val extensionsInstalledByApp =
|
||||
extensions.filter { extensionManager.isInstalledByApp(it) }
|
||||
val intent =
|
||||
ExtensionInstallService.jobIntent(
|
||||
context,
|
||||
extensionsInstalledByApp,
|
||||
// Re reun this job if not all the extensions can be auto updated
|
||||
if (extensionsInstalledByApp.size == extensions.size) {
|
||||
1
|
||||
} else {
|
||||
2
|
||||
}
|
||||
)
|
||||
context.startForegroundService(intent)
|
||||
if (extensionsInstalledByApp.size == extensions.size) {
|
||||
return
|
||||
} else {
|
||||
extensions.removeAll(extensionsInstalledByApp)
|
||||
if (extensionsInstalledByApp.isNotEmpty()) {
|
||||
val intent =
|
||||
ExtensionInstallService.jobIntent(
|
||||
context,
|
||||
extensionsInstalledByApp,
|
||||
// Re run this job if not all the extensions can be auto updated
|
||||
if (extensionsInstalledByApp.size == extensions.size) {
|
||||
1
|
||||
} else {
|
||||
2
|
||||
}
|
||||
)
|
||||
context.startForegroundService(intent)
|
||||
if (extensionsInstalledByApp.size == extensions.size) {
|
||||
return
|
||||
} else {
|
||||
extensions.removeAll(extensionsInstalledByApp)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
runJobAgain(context, NetworkType.UNMETERED)
|
||||
|
Loading…
Reference in New Issue
Block a user