Throttle SponsorBlock seek

This commit is contained in:
Arkadiusz Fal 2022-04-17 11:32:04 +02:00
parent 3953bce8f8
commit f32247d125

View File

@ -250,6 +250,8 @@ final class MPVBackend: PlayerBackend {
clientTimer.resume() clientTimer.resume()
} }
private var handleSegmentsThrottle = Throttle(interval: 1)
private func getClientUpdates() { private func getClientUpdates() {
self.logger.info("getting client updates") self.logger.info("getting client updates")
@ -262,9 +264,11 @@ final class MPVBackend: PlayerBackend {
model.updateNowPlayingInfo() model.updateNowPlayingInfo()
handleSegmentsThrottle.execute {
if let currentTime = currentTime { if let currentTime = currentTime {
model.handleSegments(at: currentTime) model.handleSegments(at: currentTime)
} }
}
timeObserverThrottle.execute { timeObserverThrottle.execute {
self.model.updateWatch() self.model.updateWatch()