mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Merge pull request #648 from stonerl/sponsorblock-jump-to-end
SponsorBlock jump to end instead of pausing
This commit is contained in:
commit
a6c5c3905a
@ -44,22 +44,6 @@ extension PlayerModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func skip(_ segment: Segment, at time: CMTime) {
|
private func skip(_ segment: Segment, at time: CMTime) {
|
||||||
if let duration = playerItemDuration, segment.endTime.seconds >= duration.seconds - 3 {
|
|
||||||
logger.error("segment end time is: \(segment.end) when player item duration is: \(duration.seconds)")
|
|
||||||
|
|
||||||
DispatchQueue.main.async { [weak self] in
|
|
||||||
guard let self else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
self.pause()
|
|
||||||
|
|
||||||
self.backend.eofPlaybackModeAction()
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
backend.seek(to: segment.endTime, seekType: .segmentSkip(segment.category))
|
backend.seek(to: segment.endTime, seekType: .segmentSkip(segment.category))
|
||||||
|
|
||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
@ -69,6 +53,14 @@ extension PlayerModel {
|
|||||||
self?.segmentRestorationTime = time
|
self?.segmentRestorationTime = time
|
||||||
}
|
}
|
||||||
logger.info("SponsorBlock skipping to: \(segment.end)")
|
logger.info("SponsorBlock skipping to: \(segment.end)")
|
||||||
|
|
||||||
|
if let duration = playerItemDuration, segment.endTime.seconds >= duration.seconds - 3 {
|
||||||
|
logger.error("Segment end time is: \(segment.end) when player item duration is: \(duration.seconds)")
|
||||||
|
|
||||||
|
DispatchQueue.main.async { [weak self] in
|
||||||
|
self?.backend.eofPlaybackModeAction()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func shouldSkip(_ segment: Segment, at time: CMTime) -> Bool {
|
private func shouldSkip(_ segment: Segment, at time: CMTime) -> Bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user