1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 14:50:32 +05:30
yattee/Model/SponsorBlock/SponsorBlockSegment.swift

25 lines
598 B
Swift
Raw Normal View History

2021-06-18 04:13:29 +05:30
import Foundation
import SwiftyJSON
final class SponsorBlockSegment: Segment {
init(_ json: JSON) {
super.init(
category: json["category"].string!,
segment: json["segment"].array!.map { $0.double! },
uuid: json["UUID"].string!,
videoDuration: json["videoDuration"].int!
)
}
override func title() -> String {
switch category {
case "selfpromo":
return "self-promotion"
case "music_offtopic":
2021-10-23 22:19:45 +05:30
return "offtopic"
2021-06-18 04:13:29 +05:30
default:
return category
}
}
}