2024-06-21 19:35:40 +05:30
|
|
|
//
|
|
|
|
|
// WebSeriesEpisodeCell.swift
|
|
|
|
|
// WOKA
|
|
|
|
|
//
|
|
|
|
|
// Created by Bilal on 21/06/2024.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
|
|
class WebSeriesEpisodeCell: UITableViewCell {
|
|
|
|
|
|
|
|
|
|
@IBOutlet weak var seasonImage: UIImageView!
|
|
|
|
|
@IBOutlet weak var seasonTitle: UILabel!
|
|
|
|
|
@IBOutlet weak var seasonTime: UILabel!
|
|
|
|
|
@IBOutlet weak var playBtn: UIButton!
|
|
|
|
|
|
2024-06-25 11:29:00 +05:30
|
|
|
typealias btnTappedBlock = () -> Void // 0 - plus 1 - minus
|
|
|
|
|
var btnTapped : btnTappedBlock!
|
|
|
|
|
|
2024-06-21 19:35:40 +05:30
|
|
|
override func awakeFromNib() {
|
|
|
|
|
super.awakeFromNib()
|
2024-06-25 11:29:00 +05:30
|
|
|
|
2024-06-21 19:35:40 +05:30
|
|
|
// Initialization code
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
|
|
|
super.setSelected(selected, animated: animated)
|
|
|
|
|
|
|
|
|
|
// Configure the view for the selected state
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-16 19:56:09 +05:30
|
|
|
func setData(data : EpisodeListingDM.ResultData){
|
2024-06-25 11:29:00 +05:30
|
|
|
if let url = data.thumbnailPath{
|
2024-08-07 20:21:47 +05:30
|
|
|
self.seasonImage.imageURL(url, color: UIColor.appColor(.TextDarkBlue)!)
|
2024-06-25 11:29:00 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
self.seasonTime.text = data.episodeDuration ?? "0:00:00"
|
|
|
|
|
|
|
|
|
|
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
|
|
|
|
|
seasonTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first?.title
|
|
|
|
|
}else{
|
|
|
|
|
seasonTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 2}).first?.title
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func setTeaserData(data : TeaserDM.ResultData){
|
2024-06-21 19:35:40 +05:30
|
|
|
if let url = data.thumbnailPath{
|
2024-07-15 20:10:33 +05:30
|
|
|
self.seasonImage.imageURL(url, color: .black)
|
2024-06-21 19:35:40 +05:30
|
|
|
}
|
|
|
|
|
|
2024-06-25 11:29:00 +05:30
|
|
|
self.seasonTime.text = data.teaserDuration ?? "0:00:00"
|
|
|
|
|
|
2024-06-21 19:35:40 +05:30
|
|
|
if AuthFunc.shareInstance.getDefaultLanguage() == .english{
|
2024-06-25 11:29:00 +05:30
|
|
|
seasonTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 1}).first?.title
|
2024-06-21 19:35:40 +05:30
|
|
|
}else{
|
2024-06-25 11:29:00 +05:30
|
|
|
seasonTitle.text = data.contentMoreDetails?.filter({$0.languageMasterID == 2}).first?.title
|
2024-06-21 19:35:40 +05:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@IBAction func playBtnTapped(_ sender: UIButton) {
|
2024-06-25 11:29:00 +05:30
|
|
|
if btnTapped != nil {
|
|
|
|
|
btnTapped()
|
|
|
|
|
}
|
2024-06-21 19:35:40 +05:30
|
|
|
}
|
|
|
|
|
}
|