mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-31 15:19:34 +02:00
Fix NaN causing bad data
This commit is contained in:
parent
d084958f2d
commit
fe042f3f83
1 changed files with 1 additions and 0 deletions
|
@ -47,6 +47,7 @@ class PlayerProgress {
|
||||||
|
|
||||||
private func updateLocalSessionFromPlayer(currentTime: Double, includesPlayProgress: Bool) async -> PlaybackSession? {
|
private func updateLocalSessionFromPlayer(currentTime: Double, includesPlayProgress: Bool) async -> PlaybackSession? {
|
||||||
guard let session = PlayerHandler.getPlaybackSession() else { return nil }
|
guard let session = PlayerHandler.getPlaybackSession() else { return nil }
|
||||||
|
guard !currentTime.isNaN else { return nil } // Prevent bad data on player stop
|
||||||
|
|
||||||
let now = Date().timeIntervalSince1970 * 1000
|
let now = Date().timeIntervalSince1970 * 1000
|
||||||
let lastUpdate = session.updatedAt ?? now
|
let lastUpdate = session.updatedAt ?? now
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue