mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
feat: Option to prune finished workers
This commit is contained in:
parent
7719847106
commit
dbd007127d
1 changed files with 15 additions and 0 deletions
|
@ -66,6 +66,7 @@ import eu.kanade.tachiyomi.util.system.localeContext
|
|||
import eu.kanade.tachiyomi.util.system.materialAlertDialog
|
||||
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.util.system.workManager
|
||||
import eu.kanade.tachiyomi.util.view.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.view.setMessage
|
||||
import eu.kanade.tachiyomi.util.view.setPositiveButton
|
||||
|
@ -418,6 +419,20 @@ class SettingsAdvancedController : SettingsLegacyController() {
|
|||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Prune finished workers"
|
||||
summary = "In case worker stuck in FAILED state and you're too impatient to wait"
|
||||
onClick {
|
||||
activity!!.materialAlertDialog()
|
||||
.setTitle("Are you sure?")
|
||||
.setMessage("Failed workers should clear out by itself eventually, " +
|
||||
"this option should only be used if you're being impatient and you know what you're doing.")
|
||||
.setPositiveButton("Prune") { _, _ -> context.workManager.pruneWork() }
|
||||
.setNegativeButton("Cancel", null)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue