Update:iOS remove paused timer that synced with the server when current media was paused

This commit is contained in:
advplyr
2023-11-12 13:49:20 -06:00
parent ad5146e2ee
commit a7cbdbfbbb
3 changed files with 5 additions and 36 deletions
+1 -11
View File
@@ -36,17 +36,6 @@ class PlayerProgress {
await UIApplication.shared.endBackgroundTask(backgroundToken)
}
public func syncFromServer() async {
let backgroundToken = await UIApplication.shared.beginBackgroundTask(withName: "ABS:syncFromServer")
do {
try await updateLocalSessionFromServerMediaProgress()
} catch {
logger.error("Failed to syncFromServer")
logger.error(error)
}
await UIApplication.shared.endBackgroundTask(backgroundToken)
}
// MARK: - SYNC LOGIC
@@ -164,6 +153,7 @@ class PlayerProgress {
}
}
// TODO: Unused for now
private func updateLocalSessionFromServerMediaProgress() async throws {
logger.log("updateLocalSessionFromServerMediaProgress: Checking if local media progress was updated on server")
guard let session = try Realm(queue: nil).objects(PlaybackSession.self).last(where: {