Add Sponsor Block and settings

This commit is contained in:
Arkadiusz Fal
2021-10-23 18:49:45 +02:00
parent e64a520d5e
commit 8e0af22b94
21 changed files with 362 additions and 114 deletions

View File

@@ -13,10 +13,18 @@ class Segment: ObservableObject, Hashable {
segment.first!
}
var startTime: CMTime {
CMTime(seconds: start, preferredTimescale: 1000)
}
var end: Double {
segment.last!
}
var endTime: CMTime {
CMTime(seconds: end, preferredTimescale: 1000)
}
var duration: Double {
end - start
}
@@ -32,10 +40,6 @@ class Segment: ObservableObject, Hashable {
(start ... end).contains(time.seconds)
}
var skipTo: CMTime {
CMTime(seconds: segment.last!, preferredTimescale: 1000)
}
func hash(into hasher: inout Hasher) {
hasher.combine(uuid)
}
@@ -47,8 +51,4 @@ class Segment: ObservableObject, Hashable {
func title() -> String {
category
}
func shouldSkip(_ atTime: CMTime) -> Bool {
atTime.seconds - start < 2 && end - atTime.seconds > 2
}
}