chore: ktlint.

Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
KaiserBh 2023-12-29 01:59:14 +11:00
parent 0d117b84c0
commit 37033cbfc3
No known key found for this signature in database
GPG Key ID: 14D73B142042BBA9
3 changed files with 8 additions and 5 deletions

View File

@ -138,7 +138,6 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE)) LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE))
} }
val syncPreferences: SyncPreferences by injectLazy() val syncPreferences: SyncPreferences by injectLazy()
val syncFlags = syncPreferences.syncFlags().get() val syncFlags = syncPreferences.syncFlags().get()
if (syncPreferences.isSyncEnabled() && syncFlags and SyncPreferences.Flags.SYNC_ON_APP_START == SyncPreferences.Flags.SYNC_ON_APP_START) { if (syncPreferences.isSyncEnabled() && syncFlags and SyncPreferences.Flags.SYNC_ON_APP_START == SyncPreferences.Flags.SYNC_ON_APP_START) {

View File

@ -490,7 +490,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
// Only proceed with SyncDataJob if sync is enabled and the specific sync on library update flag is set // Only proceed with SyncDataJob if sync is enabled and the specific sync on library update flag is set
if (syncPreferences.isSyncEnabled() && syncPreferences.syncFlags().get() and SyncPreferences.Flags.SYNC_ON_LIBRARY_UPDATE == SyncPreferences.Flags.SYNC_ON_LIBRARY_UPDATE) { if (syncPreferences.isSyncEnabled() && syncPreferences.syncFlags().get() and SyncPreferences.Flags.SYNC_ON_LIBRARY_UPDATE == SyncPreferences.Flags.SYNC_ON_LIBRARY_UPDATE) {
// Check if SyncDataJob is already running // Check if SyncDataJob is already running
if (wm.isRunning(SyncDataJob.TAG_MANUAL)) { if (wm.isRunning(SyncDataJob.TAG_MANUAL)) {
// SyncDataJob is already running // SyncDataJob is already running
@ -513,7 +512,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
wm.beginUniqueWork(WORK_NAME_MANUAL, ExistingWorkPolicy.KEEP, syncDataJob) wm.beginUniqueWork(WORK_NAME_MANUAL, ExistingWorkPolicy.KEEP, syncDataJob)
.then(libraryUpdateJob) .then(libraryUpdateJob)
.enqueue() .enqueue()
} else { } else {
val inputData = workDataOf(KEY_CATEGORY to category?.id) val inputData = workDataOf(KEY_CATEGORY to category?.id)
val request = OneTimeWorkRequestBuilder<LibraryUpdateJob>() val request = OneTimeWorkRequestBuilder<LibraryUpdateJob>()
@ -528,7 +526,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
return true return true
} }
fun stop(context: Context) { fun stop(context: Context) {
val wm = context.workManager val wm = context.workManager
val workQuery = WorkQuery.Builder.fromTags(listOf(TAG)) val workQuery = WorkQuery.Builder.fromTags(listOf(TAG))

View File

@ -16,7 +16,14 @@ class SyncPreferences(
const val Defaults = NONE const val Defaults = NONE
fun values() = listOf(NONE, SYNC_ON_CHAPTER_READ, SYNC_ON_CHAPTER_OPEN, SYNC_ON_APP_START, SYNC_ON_APP_RESUME, SYNC_ON_LIBRARY_UPDATE) fun values() = listOf(
NONE,
SYNC_ON_CHAPTER_READ,
SYNC_ON_CHAPTER_OPEN,
SYNC_ON_APP_START,
SYNC_ON_APP_RESUME,
SYNC_ON_LIBRARY_UPDATE,
)
} }
fun syncHost() = preferenceStore.getString("sync_host", "https://sync.tachiyomi.org") fun syncHost() = preferenceStore.getString("sync_host", "https://sync.tachiyomi.org")