mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 15:02:49 +01:00
chore: ktlint.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
parent
0d117b84c0
commit
37033cbfc3
@ -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) {
|
||||||
|
@ -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))
|
||||||
|
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user