mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
22 lines
464 B
Swift
22 lines
464 B
Swift
import Foundation
|
|
import SwiftyJSON
|
|
|
|
struct Thumbnail {
|
|
enum Quality: String, CaseIterable {
|
|
case maxres, maxresdefault, sddefault, high, medium, `default`, start, middle, end
|
|
}
|
|
|
|
var url: URL
|
|
var quality: Quality
|
|
|
|
init(_ json: JSON) {
|
|
url = json["url"].url!
|
|
quality = Quality(rawValue: json["quality"].string!)!
|
|
}
|
|
|
|
init(url: URL, quality: Quality) {
|
|
self.url = url
|
|
self.quality = quality
|
|
}
|
|
}
|