mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Reset sponsorblock segments for local videos
This commit is contained in:
parent
33abe4d487
commit
7a2dcc3cf1
@ -388,6 +388,10 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
if video.isLocal {
|
||||
resetSegments()
|
||||
}
|
||||
|
||||
(withBackend ?? backend).playStream(
|
||||
stream,
|
||||
of: video,
|
||||
@ -436,7 +440,9 @@ final class PlayerModel: ObservableObject {
|
||||
changeActiveBackend(from: activeBackend, to: backend)
|
||||
}
|
||||
|
||||
guard let stream = (((availableStreams.count == 1 && availableStreams.first!.isLocal) ? availableStreams.first : nil) ?? streamByQualityProfile),
|
||||
let localStream = (availableStreams.count == 1 && availableStreams.first!.isLocal) ? availableStreams.first : nil
|
||||
|
||||
guard let stream = localStream ?? streamByQualityProfile,
|
||||
let currentVideo
|
||||
else {
|
||||
return
|
||||
|
@ -80,6 +80,11 @@ final class SponsorBlockAPI: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func reset() {
|
||||
videoID = nil
|
||||
segments = []
|
||||
}
|
||||
|
||||
private func requestSegments(categories: Set<String>, completionHandler: @escaping () -> Void = {}) {
|
||||
guard let url = skipSegmentsURL, !categories.isEmpty else {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user