2022-12-17 12:37:46 +00:00
|
|
|
import Foundation
|
|
|
|
|
2022-12-27 05:44:40 +00:00
|
|
|
public struct MediaAttachement: Codable, Identifiable, Hashable {
|
|
|
|
|
|
|
|
public struct MetaContainer: Codable, Equatable {
|
|
|
|
public struct Meta: Codable, Equatable {
|
|
|
|
public let width: Int?
|
|
|
|
public let height: Int?
|
|
|
|
}
|
|
|
|
public let original: Meta
|
|
|
|
}
|
|
|
|
|
2022-12-19 15:01:23 +00:00
|
|
|
public enum SupportedType: String {
|
|
|
|
case image, gifv
|
|
|
|
}
|
|
|
|
|
2022-12-19 18:04:07 +00:00
|
|
|
public func hash(into hasher: inout Hasher) {
|
|
|
|
hasher.combine(id)
|
|
|
|
}
|
|
|
|
|
2022-12-17 12:37:46 +00:00
|
|
|
public let id: String
|
|
|
|
public let type: String
|
2022-12-19 15:01:23 +00:00
|
|
|
public var supportedType: SupportedType? {
|
|
|
|
SupportedType(rawValue: type)
|
|
|
|
}
|
2022-12-17 12:37:46 +00:00
|
|
|
public let url: URL
|
2022-12-21 11:39:29 +00:00
|
|
|
public let previewUrl: URL?
|
2022-12-17 12:37:46 +00:00
|
|
|
public let description: String?
|
2022-12-27 05:44:40 +00:00
|
|
|
public let meta: MetaContainer?
|
2022-12-17 12:37:46 +00:00
|
|
|
}
|
|
|
|
|