mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 07:21:58 +00:00
ref: adjust cloud foreground refresh
This commit is contained in:
parent
c6b3f71ec4
commit
06222ecce1
1 changed files with 17 additions and 1 deletions
|
|
@ -96,7 +96,23 @@ object SyncManager {
|
||||||
if (currentAuthState !is AuthState.Authenticated || currentAuthState.isAnonymous) return@launch
|
if (currentAuthState !is AuthState.Authenticated || currentAuthState.isAnonymous) return@launch
|
||||||
|
|
||||||
lastForegroundPullAtMs = TraktPlatformClock.nowEpochMs()
|
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" } }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue