mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 06:52:49 +01:00
refactor: update imports
This commit is contained in:
parent
bc326f8fb4
commit
dbc6dac180
@ -24,6 +24,7 @@ import cafe.adriel.voyager.navigator.LocalNavigator
|
|||||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||||
import eu.kanade.domain.base.BasePreferences
|
import eu.kanade.domain.base.BasePreferences
|
||||||
import eu.kanade.domain.extension.interactor.TrustExtension
|
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.Preference
|
||||||
import eu.kanade.presentation.more.settings.screen.advanced.ClearDatabaseScreen
|
import eu.kanade.presentation.more.settings.screen.advanced.ClearDatabaseScreen
|
||||||
import eu.kanade.presentation.more.settings.screen.debug.DebugInfoScreen
|
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.lang.withUIContext
|
||||||
import tachiyomi.core.util.system.logcat
|
import tachiyomi.core.util.system.logcat
|
||||||
import tachiyomi.domain.manga.interactor.ResetViewerFlags
|
import tachiyomi.domain.manga.interactor.ResetViewerFlags
|
||||||
import tachiyomi.domain.sync.SyncPreferences
|
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
import tachiyomi.presentation.core.i18n.stringResource
|
import tachiyomi.presentation.core.i18n.stringResource
|
||||||
import tachiyomi.presentation.core.util.collectAsState
|
import tachiyomi.presentation.core.util.collectAsState
|
||||||
|
@ -10,13 +10,13 @@ import androidx.work.ForegroundInfo
|
|||||||
import androidx.work.OneTimeWorkRequestBuilder
|
import androidx.work.OneTimeWorkRequestBuilder
|
||||||
import androidx.work.PeriodicWorkRequestBuilder
|
import androidx.work.PeriodicWorkRequestBuilder
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
|
import eu.kanade.domain.sync.SyncPreferences
|
||||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||||
import eu.kanade.tachiyomi.util.system.cancelNotification
|
import eu.kanade.tachiyomi.util.system.cancelNotification
|
||||||
import eu.kanade.tachiyomi.util.system.isRunning
|
import eu.kanade.tachiyomi.util.system.isRunning
|
||||||
import eu.kanade.tachiyomi.util.system.workManager
|
import eu.kanade.tachiyomi.util.system.workManager
|
||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import tachiyomi.core.util.system.logcat
|
import tachiyomi.core.util.system.logcat
|
||||||
import tachiyomi.domain.sync.SyncPreferences
|
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.sync
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
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.BackupCreator
|
||||||
import eu.kanade.tachiyomi.data.backup.create.BackupOptions
|
import eu.kanade.tachiyomi.data.backup.create.BackupOptions
|
||||||
import eu.kanade.tachiyomi.data.backup.models.Backup
|
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.category.interactor.GetCategories
|
||||||
import tachiyomi.domain.manga.interactor.GetFavorites
|
import tachiyomi.domain.manga.interactor.GetFavorites
|
||||||
import tachiyomi.domain.manga.model.Manga
|
import tachiyomi.domain.manga.model.Manga
|
||||||
import tachiyomi.domain.sync.SyncPreferences
|
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -72,7 +72,7 @@ class SyncManager(
|
|||||||
* from the database using the BackupManager, then synchronizes the data with a sync service.
|
* from the database using the BackupManager, then synchronizes the data with a sync service.
|
||||||
*/
|
*/
|
||||||
suspend fun syncData() {
|
suspend fun syncData() {
|
||||||
val syncOptions = syncPreferences.getSyncOptions()
|
val syncOptions = syncPreferences.getSyncSettings()
|
||||||
val databaseManga = getAllMangaFromDB()
|
val databaseManga = getAllMangaFromDB()
|
||||||
val backupOptions = BackupOptions(
|
val backupOptions = BackupOptions(
|
||||||
libraryEntries = syncOptions.libraryEntries,
|
libraryEntries = syncOptions.libraryEntries,
|
||||||
|
@ -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.Drive
|
||||||
import com.google.api.services.drive.DriveScopes
|
import com.google.api.services.drive.DriveScopes
|
||||||
import com.google.api.services.drive.model.File
|
import com.google.api.services.drive.model.File
|
||||||
|
import eu.kanade.domain.sync.SyncPreferences
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@ -26,7 +27,6 @@ import kotlinx.serialization.json.Json
|
|||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import logcat.logcat
|
import logcat.logcat
|
||||||
import tachiyomi.core.i18n.stringResource
|
import tachiyomi.core.i18n.stringResource
|
||||||
import tachiyomi.domain.sync.SyncPreferences
|
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package eu.kanade.tachiyomi.data.sync.service
|
package eu.kanade.tachiyomi.data.sync.service
|
||||||
|
|
||||||
import android.content.Context
|
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.Backup
|
||||||
import eu.kanade.tachiyomi.data.backup.models.BackupCategory
|
import eu.kanade.tachiyomi.data.backup.models.BackupCategory
|
||||||
import eu.kanade.tachiyomi.data.backup.models.BackupChapter
|
import eu.kanade.tachiyomi.data.backup.models.BackupChapter
|
||||||
@ -12,7 +13,6 @@ import kotlinx.serialization.Serializable
|
|||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import logcat.logcat
|
import logcat.logcat
|
||||||
import tachiyomi.domain.sync.SyncPreferences
|
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package eu.kanade.tachiyomi.data.sync.service
|
package eu.kanade.tachiyomi.data.sync.service
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import eu.kanade.domain.sync.SyncPreferences
|
||||||
import eu.kanade.tachiyomi.data.sync.SyncNotifier
|
import eu.kanade.tachiyomi.data.sync.SyncNotifier
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.PATCH
|
import eu.kanade.tachiyomi.network.PATCH
|
||||||
@ -17,7 +18,6 @@ import okhttp3.OkHttpClient
|
|||||||
import okhttp3.RequestBody.Companion.gzip
|
import okhttp3.RequestBody.Companion.gzip
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
import tachiyomi.core.util.system.logcat
|
import tachiyomi.core.util.system.logcat
|
||||||
import tachiyomi.domain.sync.SyncPreferences
|
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class SyncYomiSyncService(
|
class SyncYomiSyncService(
|
||||||
@ -72,8 +72,8 @@ class SyncYomiSyncService(
|
|||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun beforeSync() {
|
override suspend fun beforeSync() {
|
||||||
val host = syncPreferences.syncHost().get()
|
val host = syncPreferences.clientHost().get()
|
||||||
val apiKey = syncPreferences.syncAPIKey().get()
|
val apiKey = syncPreferences.clientAPIKey().get()
|
||||||
val lockFileApi = "$host/api/sync/lock"
|
val lockFileApi = "$host/api/sync/lock"
|
||||||
val deviceId = syncPreferences.uniqueDeviceID()
|
val deviceId = syncPreferences.uniqueDeviceID()
|
||||||
val client = OkHttpClient()
|
val client = OkHttpClient()
|
||||||
@ -129,8 +129,8 @@ class SyncYomiSyncService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun pullSyncData(): SyncData? {
|
override suspend fun pullSyncData(): SyncData? {
|
||||||
val host = syncPreferences.syncHost().get()
|
val host = syncPreferences.clientHost().get()
|
||||||
val apiKey = syncPreferences.syncAPIKey().get()
|
val apiKey = syncPreferences.clientAPIKey().get()
|
||||||
val downloadUrl = "$host/api/sync/download"
|
val downloadUrl = "$host/api/sync/download"
|
||||||
|
|
||||||
val client = OkHttpClient()
|
val client = OkHttpClient()
|
||||||
@ -155,8 +155,8 @@ class SyncYomiSyncService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun pushSyncData(syncData: SyncData) {
|
override suspend fun pushSyncData(syncData: SyncData) {
|
||||||
val host = syncPreferences.syncHost().get()
|
val host = syncPreferences.clientHost().get()
|
||||||
val apiKey = syncPreferences.syncAPIKey().get()
|
val apiKey = syncPreferences.clientAPIKey().get()
|
||||||
val uploadUrl = "$host/api/sync/upload"
|
val uploadUrl = "$host/api/sync/upload"
|
||||||
|
|
||||||
// Set timeout to 30 seconds
|
// Set timeout to 30 seconds
|
||||||
|
Loading…
Reference in New Issue
Block a user