diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/sync/SyncManager.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/sync/SyncManager.kt index 2c29dbdc..ed9617ef 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/sync/SyncManager.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/sync/SyncManager.kt @@ -96,7 +96,23 @@ object SyncManager { if (currentAuthState !is AuthState.Authenticated || currentAuthState.isAnonymous) return@launch lastForegroundPullAtMs = TraktPlatformClock.nowEpochMs() - pullAllForProfile(profileId) + pullForegroundForProfile(profileId) + } + } + + private fun pullForegroundForProfile(profileId: Int) { + scope.launch { + log.i { "pullForegroundForProfile($profileId) — syncing watch progress + library" } + + launch { + runCatching { LibraryRepository.pullFromServer(profileId) } + .onFailure { log.e(it) { "Foreground library pull failed" } } + } + + launch { + runCatching { WatchProgressRepository.pullFromServer(profileId) } + .onFailure { log.e(it) { "Foreground watch progress pull failed" } } + } } } }