mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fix: Timeline Playback
This commit is contained in:
parent
1b5925090a
commit
8f770d08f7
2 changed files with 31 additions and 7 deletions
|
|
@ -274,7 +274,17 @@ class MusicManager: ObservableObject {
|
|||
self.repeatMode = state.repeatMode
|
||||
}
|
||||
|
||||
self.timestampDate = state.lastUpdated
|
||||
// Update timestamp - use current time if state doesn't provide recent timestamp
|
||||
let stateTimestamp = state.lastUpdated
|
||||
let now = Date()
|
||||
|
||||
// If the state timestamp is very recent (within 1 second), use it
|
||||
// Otherwise, use current time for better real-time calculation
|
||||
if abs(stateTimestamp.timeIntervalSince(now)) < 1.0 {
|
||||
self.timestampDate = stateTimestamp
|
||||
} else {
|
||||
self.timestampDate = now
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the batch update on the main thread
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue