|
|
|
@ -8,6 +8,7 @@ import io.legado.app.service.CheckSourceService |
|
|
|
|
import io.legado.app.utils.startService |
|
|
|
|
import io.legado.app.utils.toastOnUi |
|
|
|
|
import io.legado.app.help.CacheManager |
|
|
|
|
import splitties.init.appCtx |
|
|
|
|
|
|
|
|
|
object CheckSource { |
|
|
|
|
var keyword = "我的" |
|
|
|
@ -18,6 +19,11 @@ object CheckSource { |
|
|
|
|
var checkInfo = CacheManager.get("checkInfo")?.toBoolean() ?: true |
|
|
|
|
var checkCategory = CacheManager.get("checkCategory")?.toBoolean() ?: true |
|
|
|
|
var checkContent = CacheManager.get("checkContent")?.toBoolean() ?: true |
|
|
|
|
var summary = "" |
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
upSummary() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun start(context: Context, sources: List<BookSource>) { |
|
|
|
|
if (sources.isEmpty()) { |
|
|
|
@ -47,5 +53,16 @@ object CheckSource { |
|
|
|
|
CacheManager.put("checkInfo", checkInfo) |
|
|
|
|
CacheManager.put("checkCategory", checkCategory) |
|
|
|
|
CacheManager.put("checkContent", checkContent) |
|
|
|
|
upSummary() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun upSummary() { |
|
|
|
|
summary = "" |
|
|
|
|
if (checkSearch) summary = "${summary} ${appCtx.getString(R.string.search)}" |
|
|
|
|
if (checkDiscovery) summary = "${summary} ${appCtx.getString(R.string.discovery)}" |
|
|
|
|
if (checkInfo) summary = "${summary} ${appCtx.getString(R.string.source_tab_info)}" |
|
|
|
|
if (checkCategory) summary = "${summary} ${appCtx.getString(R.string.chapter_list)}" |
|
|
|
|
if (checkContent) summary = "${summary} ${appCtx.getString(R.string.main_body)}" |
|
|
|
|
summary = appCtx.getString(R.string.check_source_config_summary, (timeout / 1000).toString(), summary) |
|
|
|
|
} |
|
|
|
|
} |