From 37033cbfc3bafb12d45842018f141c6213a88743 Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Fri, 29 Dec 2023 01:59:14 +1100 Subject: [PATCH] chore: ktlint. Signed-off-by: KaiserBh --- app/src/main/java/eu/kanade/tachiyomi/App.kt | 1 - .../eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt | 3 --- .../main/java/tachiyomi/domain/sync/SyncPreferences.kt | 9 ++++++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 9a4e6e1f6..bfd1c57b2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -138,7 +138,6 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory { LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE)) } - val syncPreferences: SyncPreferences by injectLazy() val syncFlags = syncPreferences.syncFlags().get() if (syncPreferences.isSyncEnabled() && syncFlags and SyncPreferences.Flags.SYNC_ON_APP_START == SyncPreferences.Flags.SYNC_ON_APP_START) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt index 07bcd7568..97fc1aeec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt @@ -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 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 if (wm.isRunning(SyncDataJob.TAG_MANUAL)) { // SyncDataJob is already running @@ -513,7 +512,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet wm.beginUniqueWork(WORK_NAME_MANUAL, ExistingWorkPolicy.KEEP, syncDataJob) .then(libraryUpdateJob) .enqueue() - } else { val inputData = workDataOf(KEY_CATEGORY to category?.id) val request = OneTimeWorkRequestBuilder() @@ -528,7 +526,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet return true } - fun stop(context: Context) { val wm = context.workManager val workQuery = WorkQuery.Builder.fromTags(listOf(TAG)) diff --git a/domain/src/main/java/tachiyomi/domain/sync/SyncPreferences.kt b/domain/src/main/java/tachiyomi/domain/sync/SyncPreferences.kt index 6e39496f7..5bb0333ef 100644 --- a/domain/src/main/java/tachiyomi/domain/sync/SyncPreferences.kt +++ b/domain/src/main/java/tachiyomi/domain/sync/SyncPreferences.kt @@ -16,7 +16,14 @@ class SyncPreferences( 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")