mirror of
				https://github.com/yattee/yattee.git
				synced 2025-10-31 20:52:04 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			598 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			598 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
| 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":
 | |
|             return "offtopic"
 | |
|         default:
 | |
|             return category
 | |
|         }
 | |
|     }
 | |
| }
 | 
