From dbc6dac18037a7b3d1aa77ea43f2e9d172fcf5de Mon Sep 17 00:00:00 2001 From: kaiserbh Date: Sat, 20 Jan 2024 17:13:17 +1100 Subject: [PATCH] refactor: update imports --- .../more/settings/screen/SettingsAdvancedScreen.kt | 2 +- .../eu/kanade/tachiyomi/data/sync/SyncDataJob.kt | 2 +- .../eu/kanade/tachiyomi/data/sync/SyncManager.kt | 4 ++-- .../data/sync/service/GoogleDriveSyncService.kt | 2 +- .../tachiyomi/data/sync/service/SyncService.kt | 2 +- .../data/sync/service/SyncYomiSyncService.kt | 14 +++++++------- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt index 9a77c8067..ac963ad38 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt @@ -24,6 +24,7 @@ import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.domain.base.BasePreferences import eu.kanade.domain.extension.interactor.TrustExtension +import eu.kanade.domain.sync.SyncPreferences import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.screen.advanced.ClearDatabaseScreen import eu.kanade.presentation.more.settings.screen.debug.DebugInfoScreen @@ -61,7 +62,6 @@ import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.interactor.ResetViewerFlags -import tachiyomi.domain.sync.SyncPreferences import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.util.collectAsState diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt index 78ed7fb84..ac4551b9e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt @@ -10,13 +10,13 @@ import androidx.work.ForegroundInfo import androidx.work.OneTimeWorkRequestBuilder import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkerParameters +import eu.kanade.domain.sync.SyncPreferences import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.util.system.cancelNotification import eu.kanade.tachiyomi.util.system.isRunning import eu.kanade.tachiyomi.util.system.workManager import logcat.LogPriority import tachiyomi.core.util.system.logcat -import tachiyomi.domain.sync.SyncPreferences import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt index dcf0d2809..cc0db5185 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncManager.kt @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.sync import android.content.Context import android.net.Uri +import eu.kanade.domain.sync.SyncPreferences import eu.kanade.tachiyomi.data.backup.create.BackupCreator import eu.kanade.tachiyomi.data.backup.create.BackupOptions import eu.kanade.tachiyomi.data.backup.models.Backup @@ -24,7 +25,6 @@ import tachiyomi.data.manga.MangaMapper.mapManga import tachiyomi.domain.category.interactor.GetCategories import tachiyomi.domain.manga.interactor.GetFavorites import tachiyomi.domain.manga.model.Manga -import tachiyomi.domain.sync.SyncPreferences import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.io.File @@ -72,7 +72,7 @@ class SyncManager( * from the database using the BackupManager, then synchronizes the data with a sync service. */ suspend fun syncData() { - val syncOptions = syncPreferences.getSyncOptions() + val syncOptions = syncPreferences.getSyncSettings() val databaseManga = getAllMangaFromDB() val backupOptions = BackupOptions( libraryEntries = syncOptions.libraryEntries, diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/GoogleDriveSyncService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/GoogleDriveSyncService.kt index cd1ba9a89..b532d89f8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/GoogleDriveSyncService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/GoogleDriveSyncService.kt @@ -18,6 +18,7 @@ import com.google.api.client.json.jackson2.JacksonFactory import com.google.api.services.drive.Drive import com.google.api.services.drive.DriveScopes import com.google.api.services.drive.model.File +import eu.kanade.domain.sync.SyncPreferences import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.withContext @@ -26,7 +27,6 @@ import kotlinx.serialization.json.Json import logcat.LogPriority import logcat.logcat import tachiyomi.core.i18n.stringResource -import tachiyomi.domain.sync.SyncPreferences import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncService.kt index c1e591c46..7faac8ea0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncService.kt @@ -1,6 +1,7 @@ package eu.kanade.tachiyomi.data.sync.service import android.content.Context +import eu.kanade.domain.sync.SyncPreferences import eu.kanade.tachiyomi.data.backup.models.Backup import eu.kanade.tachiyomi.data.backup.models.BackupCategory import eu.kanade.tachiyomi.data.backup.models.BackupChapter @@ -12,7 +13,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json import logcat.LogPriority import logcat.logcat -import tachiyomi.domain.sync.SyncPreferences import java.time.Instant @Serializable diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt index 3f360fdae..1b67aed92 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/service/SyncYomiSyncService.kt @@ -1,6 +1,7 @@ package eu.kanade.tachiyomi.data.sync.service import android.content.Context +import eu.kanade.domain.sync.SyncPreferences import eu.kanade.tachiyomi.data.sync.SyncNotifier import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.PATCH @@ -17,7 +18,6 @@ import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.gzip import okhttp3.RequestBody.Companion.toRequestBody import tachiyomi.core.util.system.logcat -import tachiyomi.domain.sync.SyncPreferences import java.util.concurrent.TimeUnit class SyncYomiSyncService( @@ -72,8 +72,8 @@ class SyncYomiSyncService( ) override suspend fun beforeSync() { - val host = syncPreferences.syncHost().get() - val apiKey = syncPreferences.syncAPIKey().get() + val host = syncPreferences.clientHost().get() + val apiKey = syncPreferences.clientAPIKey().get() val lockFileApi = "$host/api/sync/lock" val deviceId = syncPreferences.uniqueDeviceID() val client = OkHttpClient() @@ -129,8 +129,8 @@ class SyncYomiSyncService( } override suspend fun pullSyncData(): SyncData? { - val host = syncPreferences.syncHost().get() - val apiKey = syncPreferences.syncAPIKey().get() + val host = syncPreferences.clientHost().get() + val apiKey = syncPreferences.clientAPIKey().get() val downloadUrl = "$host/api/sync/download" val client = OkHttpClient() @@ -155,8 +155,8 @@ class SyncYomiSyncService( } override suspend fun pushSyncData(syncData: SyncData) { - val host = syncPreferences.syncHost().get() - val apiKey = syncPreferences.syncAPIKey().get() + val host = syncPreferences.clientHost().get() + val apiKey = syncPreferences.clientAPIKey().get() val uploadUrl = "$host/api/sync/upload" // Set timeout to 30 seconds