mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
AutoUpdaterJob -> AutoAppUpdaterJob
This was missed before
This commit is contained in:
parent
9f033cbac0
commit
579c79d7f4
6 changed files with 15 additions and 15 deletions
|
@ -11,7 +11,7 @@ import com.tfcporciuncula.flow.Preference
|
|||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.data.updater.AutoUpdaterJob
|
||||
import eu.kanade.tachiyomi.data.updater.AutoAppUpdaterJob
|
||||
import eu.kanade.tachiyomi.extension.model.InstalledExtensionsOrder
|
||||
import eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet
|
||||
import eu.kanade.tachiyomi.ui.reader.settings.OrientationType
|
||||
|
@ -101,7 +101,7 @@ class PreferencesHelper(val context: Context) {
|
|||
|
||||
fun themeDarkAmoled() = flowPrefs.getBoolean(Keys.themeDarkAmoled, false)
|
||||
|
||||
val isOnA12 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
private val isOnA12 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
fun lightTheme() = flowPrefs.getEnum(Keys.lightTheme, if (isOnA12) Themes.MONET else Themes.DEFAULT)
|
||||
fun darkTheme() = flowPrefs.getEnum(Keys.darkTheme, if (isOnA12) Themes.MONET else Themes.DEFAULT)
|
||||
|
||||
|
@ -418,9 +418,9 @@ class PreferencesHelper(val context: Context) {
|
|||
|
||||
fun sideNavMode() = flowPrefs.getInt(Keys.sideNavMode, 0)
|
||||
|
||||
fun appShouldAutoUpdate() = prefs.getInt(Keys.shouldAutoUpdate, AutoUpdaterJob.ONLY_ON_UNMETERED)
|
||||
fun appShouldAutoUpdate() = prefs.getInt(Keys.shouldAutoUpdate, AutoAppUpdaterJob.ONLY_ON_UNMETERED)
|
||||
|
||||
fun autoUpdateExtensions() = prefs.getInt(Keys.autoUpdateExtensions, AutoUpdaterJob.ONLY_ON_UNMETERED)
|
||||
fun autoUpdateExtensions() = prefs.getInt(Keys.autoUpdateExtensions, AutoAppUpdaterJob.ONLY_ON_UNMETERED)
|
||||
|
||||
fun filterChapterByRead() = flowPrefs.getInt(Keys.defaultChapterFilterByRead, Manga.SHOW_ALL)
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ class AppUpdateJob(private val context: Context, workerParams: WorkerParameters)
|
|||
val result = AppUpdateChecker.getUpdateChecker().checkForUpdate()
|
||||
if (result is AppUpdateResult.NewUpdate<*>) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
|
||||
preferences.appShouldAutoUpdate() != AutoUpdaterJob.NEVER
|
||||
preferences.appShouldAutoUpdate() != AutoAppUpdaterJob.NEVER
|
||||
) {
|
||||
AutoUpdaterJob.setupTask(context)
|
||||
AutoAppUpdaterJob.setupTask(context)
|
||||
}
|
||||
AppUpdateNotifier(context).promptUpdate(
|
||||
result.release.info,
|
||||
|
|
|
@ -14,7 +14,7 @@ import kotlinx.coroutines.coroutineScope
|
|||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
class AutoUpdaterJob(private val context: Context, workerParams: WorkerParameters) :
|
||||
class AutoAppUpdaterJob(private val context: Context, workerParams: WorkerParameters) :
|
||||
CoroutineWorker(context, workerParams) {
|
||||
|
||||
override suspend fun doWork(): Result = coroutineScope {
|
||||
|
@ -57,7 +57,7 @@ class AutoUpdaterJob(private val context: Context, workerParams: WorkerParameter
|
|||
.setRequiresDeviceIdle(true)
|
||||
.build()
|
||||
|
||||
val request = OneTimeWorkRequestBuilder<AutoUpdaterJob>()
|
||||
val request = OneTimeWorkRequestBuilder<AutoAppUpdaterJob>()
|
||||
.addTag(TAG)
|
||||
.setConstraints(constraints)
|
||||
.build()
|
|
@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
|||
import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.updater.AutoUpdaterJob
|
||||
import eu.kanade.tachiyomi.data.updater.AutoAppUpdaterJob
|
||||
import eu.kanade.tachiyomi.extension.api.ExtensionGithubApi
|
||||
import eu.kanade.tachiyomi.extension.model.Extension
|
||||
import eu.kanade.tachiyomi.util.system.connectivityManager
|
||||
|
@ -61,7 +61,7 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
|||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
|
||||
inputData.getBoolean(RUN_AUTO, true) &&
|
||||
preferences.autoUpdateExtensions() != AutoUpdaterJob.NEVER &&
|
||||
preferences.autoUpdateExtensions() != AutoAppUpdaterJob.NEVER &&
|
||||
!ExtensionInstallService.isRunning() &&
|
||||
extensionsInstalledByApp.isNotEmpty()
|
||||
) {
|
||||
|
@ -69,7 +69,7 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
|||
val libraryServiceRunning = LibraryUpdateService.isRunning()
|
||||
if (
|
||||
(
|
||||
preferences.autoUpdateExtensions() == AutoUpdaterJob.ALWAYS ||
|
||||
preferences.autoUpdateExtensions() == AutoAppUpdaterJob.ALWAYS ||
|
||||
!cm.isActiveNetworkMetered
|
||||
) && !libraryServiceRunning
|
||||
) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.R
|
|||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys
|
||||
import eu.kanade.tachiyomi.data.preference.asImmediateFlowIn
|
||||
import eu.kanade.tachiyomi.data.updater.AutoUpdaterJob
|
||||
import eu.kanade.tachiyomi.data.updater.AutoAppUpdaterJob
|
||||
import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||
|
@ -51,7 +51,7 @@ class SettingsBrowseController : SettingsController() {
|
|||
R.string.over_wifi_only,
|
||||
R.string.dont_auto_update
|
||||
)
|
||||
defaultValue = AutoUpdaterJob.ONLY_ON_UNMETERED
|
||||
defaultValue = AutoAppUpdaterJob.ONLY_ON_UNMETERED
|
||||
}
|
||||
val infoPref = infoPreference(R.string.some_extensions_may_not_update)
|
||||
val switchPref = switchPreference {
|
||||
|
|
|
@ -6,7 +6,7 @@ import android.view.View
|
|||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.updater.AutoUpdaterJob
|
||||
import eu.kanade.tachiyomi.data.updater.AutoAppUpdaterJob
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsGeneralController : SettingsController() {
|
||||
|
@ -97,7 +97,7 @@ class SettingsGeneralController : SettingsController() {
|
|||
titleRes = R.string.auto_update_app
|
||||
entryRange = 0..2
|
||||
entriesRes = arrayOf(R.string.over_any_network, R.string.over_wifi_only, R.string.dont_auto_update)
|
||||
defaultValue = AutoUpdaterJob.ONLY_ON_UNMETERED
|
||||
defaultValue = AutoAppUpdaterJob.ONLY_ON_UNMETERED
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue