mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 14:20:32 +05:30
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
|
|
}
|
|
}
|