ThimraTV/ThimraTV/Class/Player/Model/SPShortModel.swift

85 lines
1.8 KiB
Swift

//
// SPShortModel.swift
// ThimraTV
//
// Created by on 2025/4/9.
//
import UIKit
import SmartCodable
class SPShortModel: SPModel, SmartCodable {
enum VideoRevolution: String, SmartCaseDefaultable {
case r_540 = "540"
case r_720 = "720"
case r_1080 = "1080"
var needLogin: Bool {
if self == .r_720 {
return true
} else {
return false
}
}
var needVip: Bool {
if self == .r_1080 {
return true
} else {
return false
}
}
var toString: String {
return "\(self.rawValue)P"
}
}
enum TagType: String, SmartCaseDefaultable {
case hot = "hot"
case new = "new"
}
var id: String?
var all_coins: String?
var buy_type: String?
var collect_total: Int?
var sp_description: String?
var episode_total: Int?
var horizontally_img: String?
var image_url: String?
var is_collect: Bool?
var name: String?
var process: String?
var search_click_total: String?
var short_id: String?
var short_play_id: String?
var short_play_video_id: String?
var tag_type: TagType?
var video_info: SPVideoInfoModel?
var category: [String]?
///
var watch_total: Int?
var current_episode: String?
var video_url: String?
///
var revolution: VideoRevolution?
@IgnoredKey
var titleAttributedString: NSAttributedString?
@IgnoredKey
var sp_isSelected: Bool?
@IgnoredKey
var blurImage: UIImage?
static func mappingForKey() -> [SmartKeyTransformer]? {
return [
CodingKeys.sp_description <--- ["description"]
]
}
}