package com.ss.android.ugc.aweme.im.sdk.chat.data.model;

import X.9EH;
import X.P94;
import android.content.Context;
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 com.ss.android.ugc.aweme.im.sdk.share.data.model.PureDataSharePackage;
import com.ss.android.ugc.aweme.sharer.ui.SharePackage;
import java.util.List;

public class ShareMusicContent extends BaseContent {
    @c(LIZ = "cover_url")
    public List<UrlModel> awemeCoverList;
    @c(LIZ = "music_cover")
    public UrlModel coverThumb;
    @c(LIZ = "music_id")
    public String musicId;
    @c(LIZ = "title")
    public String musicName;
    @c(LIZ = "push_detail")
    public String pushDetail;
    @c(LIZ = "user_count")
    public int userCount;

    static {
        Covode.recordClassIndex(84126);
    }

    public List<UrlModel> getAwemeCoverList() {
        return this.awemeCoverList;
    }

    public UrlModel getCoverThumb() {
        return this.coverThumb;
    }

    public String getMusicId() {
        return this.musicId;
    }

    public String getMusicName() {
        return this.musicName;
    }

    public String getPushDetail() {
        return this.pushDetail;
    }

    public int getUserCount() {
        return this.userCount;
    }

    public List<UrlModel> fetchPreload() {
        List<UrlModel> list = this.awemeCoverList;
        if (list == null || list.isEmpty()) {
            return null;
        }
        return this.awemeCoverList.subList(0, Math.min(3, this.awemeCoverList.size()));
    }

    public SharePackage generateSharePackage() {
        SharePackage LIZ = PureDataSharePackage.LIZ.LIZ("music");
        LIZ.LJIILJJIL.putSerializable("video_cover", getCoverThumb());
        return LIZ;
    }

    public String getMsgHint() {
        return 9EH.LJJIFFI.LIZ().getString(2131825908, new Object[]{getMusicName()});
    }

    public void setAwemeCoverList(List<UrlModel> list) {
        this.awemeCoverList = list;
    }

    public void setCoverThumb(UrlModel urlModel) {
        this.coverThumb = urlModel;
    }

    public void setMusicId(String str) {
        this.musicId = str;
    }

    public void setMusicName(String str) {
        this.musicName = str;
    }

    public void setPushDetail(String str) {
        this.pushDetail = str;
    }

    public void setUserCount(int i) {
        this.userCount = i;
    }

    public String getQuoteHint(Context context) {
        return context.getResources().getString(2131825940, new Object[]{this.musicName});
    }

    public static ShareMusicContent fromSharePackage(SharePackage sharePackage) {
        String string = sharePackage.LJIILJJIL.getString("music_id");
        String string2 = sharePackage.LJIILJJIL.getString("music_name");
        int i = sharePackage.LJIILJJIL.getInt("user_count");
        UrlModel serializable = sharePackage.LJIILJJIL.getSerializable("video_cover");
        UrlModel serializable2 = sharePackage.LJIILJJIL.getSerializable("cover_thumb");
        String string3 = sharePackage.LJIILJJIL.getString("aweme_cover_list");
        ShareMusicContent shareMusicContent = new ShareMusicContent();
        shareMusicContent.musicId = string;
        shareMusicContent.musicName = string2;
        shareMusicContent.pushDetail = string2;
        shareMusicContent.userCount = i;
        if (serializable != null) {
            shareMusicContent.coverThumb = serializable;
        } else if (serializable2 != null) {
            shareMusicContent.coverThumb = serializable2;
        }
        if (!TextUtils.isEmpty(string3)) {
            shareMusicContent.awemeCoverList = (List) P94.LIZ(string3, List.class);
        }
        return shareMusicContent;
    }

    public String wrapMsgHint(boolean z, boolean z2, String str) {
        Context LIZ = 9EH.LJJIFFI.LIZ();
        if (z || z2) {
            return LIZ.getString(2131822401);
        }
        return LIZ.getString(2131832097);
    }
}
