1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30
yattee/Model/Thumbnail.swift

40 lines
950 B
Swift
Raw Normal View History

2021-07-08 04:09:18 +05:30
import Foundation
import SwiftyJSON
struct Thumbnail {
2021-07-22 18:13:13 +05:30
enum Quality: String, CaseIterable {
case maxres, maxresdefault, sddefault, high, medium, `default`, start, middle, end
2021-10-21 03:51:50 +05:30
var filename: String {
switch self {
case .maxres:
return "maxres"
case .maxresdefault:
return "maxresdefault"
case .sddefault:
return "sddefault"
case .high:
return "hqdefault"
case .medium:
return "mqdefault"
case .default:
return "default"
case .start:
return "1"
case .middle:
return "2"
case .end:
return "3"
}
}
2021-07-22 18:13:13 +05:30
}
2021-07-08 04:09:18 +05:30
var url: URL
2021-07-22 18:13:13 +05:30
var quality: Quality
2021-07-08 04:09:18 +05:30
2021-07-22 18:13:13 +05:30
init(url: URL, quality: Quality) {
self.url = url
self.quality = quality
2021-07-08 04:09:18 +05:30
}
}