Refactor and clean up sync logic

This commit is contained in:
ronaldheft
2022-08-19 23:00:40 -04:00
parent 062a217946
commit 972fbd42ee
4 changed files with 67 additions and 72 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ public class AbsAudioPlayer: CAPPlugin {
// Fetch the most recent active session
let activeSession = try await Realm().objects(PlaybackSession.self).where({ $0.isActiveSession == true }).last
if let activeSession = activeSession {
await PlayerProgress.syncLocalFromServer()
await PlayerProgress.syncFromServer()
try self.startPlaybackSession(activeSession, playWhenReady: false, playbackRate: PlayerSettings.main().playbackRate)
}
} catch {