package com.ss.android.ugc.aweme.feed.model;

import X.AnonymousClass8FJ;
import android.os.SystemClock;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import com.ss.android.ugc.aweme.base.model.UrlModel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class VideoUrlModel extends UrlModel {
    public static final long serialVersionUID = 4566748102483196885L;
    @c(LIZ = "bit_rate")
    public List<BitRate> bitRate;
    @c(LIZ = "cdn_url_expired")
    public long cdnUrlExpired;
    public int codecType;
    public long createTime = SystemClock.elapsedRealtime();
    @c(LIZ = "duration")
    public double duration;
    @c(LIZ = "file_cs")
    public String fileCheckSum;
    public transient AnonymousClass8FJ hitBitrate;
    public String mDashVideoId;
    public String mDashVideoModelString;
    public boolean mVr;
    public String ratio;
    public String ratioUri;
    public String sourceId;
    public String videoAdTag;

    static {
        Covode.recordClassIndex(79015);
    }

    public long getCdnUrlExpired() {
        return this.cdnUrlExpired;
    }

    public int getCodecType() {
        return this.codecType;
    }

    public long getCreateTime() {
        return this.createTime;
    }

    public String getDashVideoId() {
        return this.mDashVideoId;
    }

    public String getDashVideoModelStr() {
        return this.mDashVideoModelString;
    }

    public double getDuration() {
        return this.duration;
    }

    public String getFileCheckSum() {
        return this.fileCheckSum;
    }

    public AnonymousClass8FJ getHitBitrate() {
        return this.hitBitrate;
    }

    public String getOriginUri() {
        return this.uri;
    }

    public String getRatio() {
        return this.ratio;
    }

    public String getSourceId() {
        return this.sourceId;
    }

    public String getVideoAdTag() {
        return this.videoAdTag;
    }

    public String getaK() {
        return this.aK;
    }

    public boolean isVr() {
        return this.mVr;
    }

    public boolean isBytevc1() {
        if (this.codecType == 1) {
            return true;
        }
        return false;
    }

    public List<BitRate> getBitRate() {
        List<BitRate> list = this.bitRate;
        if (list == null) {
            return Collections.emptyList();
        }
        return list;
    }

    public String getUri() {
        if (!TextUtils.isEmpty(getUrlKey())) {
            return getUrlKey();
        }
        return getRatioUri();
    }

    public String getBitRatedRatioUri() {
        String str;
        AnonymousClass8FJ r3 = this.hitBitrate;
        if (r3 == null) {
            return getUri();
        }
        String urlKey = r3.getUrlKey();
        if (!TextUtils.isEmpty(urlKey)) {
            return urlKey;
        }
        if (r3.isBytevc1() == 1) {
            str = "bytevc1";
        } else {
            str = "";
        }
        return getUri() + str + "T" + r3.getBitRate();
    }

    public String getRatioUri() {
        String str;
        if (this.ratioUri == null) {
            int i = this.codecType;
            String str2 = "";
            if (i == 2) {
                str = "bytevc2";
            } else if (i == 1) {
                str = "bytevc1";
            } else {
                str = str2;
            }
            if (this.uri != null) {
                StringBuilder sb = new StringBuilder();
                sb.append(this.uri);
                String str3 = this.ratio;
                if (str3 != null) {
                    str2 = str3;
                }
                sb.append(str2);
                sb.append(str);
                str2 = sb.toString();
            }
            this.ratioUri = str2;
        }
        return this.ratioUri;
    }

    public String toString() {
        List list = this.urlList;
        if (list != null && !list.isEmpty()) {
            list = new ArrayList(this.urlList);
        }
        List list2 = this.bitRate;
        if (list2 != null && !list2.isEmpty()) {
            list2 = new ArrayList(this.bitRate);
        }
        return "VideoUrlModel{uri='" + this.uri + '\'' + "aK='" + this.aK + '\'' + ", urlList=" + list + "sourceId='" + this.sourceId + '\'' + ", ratio='" + this.ratio + '\'' + ", mVr=" + this.mVr + ", duration=" + this.duration + ", bitRate=" + list2 + ", createTime=" + this.createTime + ", codecType=" + this.codecType + '}';
    }

    public void setBitRate(List<BitRate> list) {
        this.bitRate = list;
    }

    public void setBytevc1(boolean z) {
        this.codecType = z ? 1 : 0;
    }

    public void setCdnUrlExpired(long j) {
        this.cdnUrlExpired = j;
    }

    public void setCodecType(int i) {
        this.codecType = i;
    }

    public void setDashVideoId(String str) {
        this.mDashVideoId = str;
    }

    public void setDashVideoModelStr(String str) {
        this.mDashVideoModelString = str;
    }

    public void setDuration(double d) {
        this.duration = d;
    }

    public void setFileCheckSum(String str) {
        this.fileCheckSum = str;
    }

    public void setHitBitrate(AnonymousClass8FJ r1) {
        this.hitBitrate = r1;
    }

    public VideoUrlModel setRatio(String str) {
        this.ratio = str;
        return this;
    }

    public VideoUrlModel setSourceId(String str) {
        this.sourceId = str;
        return this;
    }

    public void setVideoAdTag(String str) {
        this.videoAdTag = str;
    }

    public void setVr(boolean z) {
        this.mVr = z;
    }

    public void setaK(String str) {
        this.aK = str;
    }
}
