From b053c4ca332c5d4385d8b5a073eb17fbef7fb525 Mon Sep 17 00:00:00 2001 From: Hariharan Mudaliar Date: Fri, 7 Nov 2025 12:25:29 +0530 Subject: [PATCH] Kinda fixed the timeline issue --- .../MediaControllers/NowPlayingController.swift | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/DynamicIsland/MediaControllers/NowPlayingController.swift b/DynamicIsland/MediaControllers/NowPlayingController.swift index f357908..2c0faa0 100644 --- a/DynamicIsland/MediaControllers/NowPlayingController.swift +++ b/DynamicIsland/MediaControllers/NowPlayingController.swift @@ -181,18 +181,9 @@ final class NowPlayingController: ObservableObject, MediaControllerProtocol { newPlaybackState.album = payload.album ?? (diff ? self.playbackState.album : "") newPlaybackState.duration = payload.duration ?? (diff ? self.playbackState.duration : 0) - if let elapsedTime = payload.elapsedTime { - newPlaybackState.currentTime = elapsedTime - } else if diff { - if payload.playing == false { - let timeSinceLastUpdate = Date().timeIntervalSince(self.playbackState.lastUpdated) - newPlaybackState.currentTime = self.playbackState.currentTime + (self.playbackState.playbackRate * timeSinceLastUpdate) - } else { - newPlaybackState.currentTime = self.playbackState.currentTime - } - } else { - newPlaybackState.currentTime = 0 - } + // Match boring.notch behavior: if elapsedTime is provided use it, + // if this update is a diff keep the previous currentTime, otherwise default to 0. + newPlaybackState.currentTime = payload.elapsedTime ?? (diff ? self.playbackState.currentTime : 0) if let shuffleMode = payload.shuffleMode {