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 3995b8cdb..5d651a400 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 @@ -61,7 +61,7 @@ class GoogleDriveSyncService(context: Context, json: Json, syncPreferences: Sync override suspend fun beforeSync() = googleDriveService.refreshToken() - override suspend fun pushSyncData(): SyncData? { + override suspend fun pullSyncData(): SyncData? { val drive = googleDriveService.googleDriveService // Check if the Google Drive service is initialized @@ -87,7 +87,7 @@ class GoogleDriveSyncService(context: Context, json: Json, syncPreferences: Sync return json.decodeFromString(SyncData.serializer(), jsonString) } - override suspend fun pullSyncData(syncData: SyncData) { + override suspend fun pushSyncData(syncData: SyncData) { val jsonData = json.encodeToString(syncData) val drive = googleDriveService.googleDriveService 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 6b20de8ac..38701ebe1 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 @@ -23,15 +23,15 @@ abstract class SyncService( open suspend fun doSync(syncData: SyncData): Backup? { beforeSync() - val remoteSData = pushSyncData() + val remoteSData = pullSyncData() val finalSyncData = if (remoteSData == null) { - pullSyncData(syncData) + pushSyncData(syncData) syncData } else { val mergedSyncData = mergeSyncData(syncData, remoteSData) - pullSyncData(mergedSyncData) + pushSyncData(mergedSyncData) mergedSyncData } @@ -46,12 +46,12 @@ abstract class SyncService( /** * Download sync data from the remote storage */ - abstract suspend fun pushSyncData(): SyncData? + abstract suspend fun pullSyncData(): SyncData? /** * Upload sync data to the remote storage */ - abstract suspend fun pullSyncData(syncData: SyncData) + abstract suspend fun pushSyncData(syncData: SyncData) /** * Merges the local and remote sync data into a single JSON string. 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 d7404bcce..936da49e3 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 @@ -22,7 +22,7 @@ class SyncYomiSyncService( syncPreferences: SyncPreferences, private val notifier: SyncNotifier, ) : SyncService(context, json, syncPreferences) { - override suspend fun pushSyncData(): SyncData? { + override suspend fun pullSyncData(): SyncData? { val host = syncPreferences.syncHost().get() val apiKey = syncPreferences.syncAPIKey().get() val downloadUrl = "$host/api/sync/download" @@ -48,7 +48,7 @@ class SyncYomiSyncService( } } - override suspend fun pullSyncData(syncData: SyncData) { + override suspend fun pushSyncData(syncData: SyncData) { val host = syncPreferences.syncHost().get() val apiKey = syncPreferences.syncAPIKey().get() val uploadUrl = "$host/api/sync/upload"