package xyz.netfly.ui.live.epg;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import e.t0;
import java.util.List;
import xyz.stream.api.entity.BaseEntity;

/* JADX INFO: loaded from: classes3.dex */
public final class k implements xyz.stream.api.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ String f35360a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ t0 f35361b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ int f35362c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ String f35363d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ q f35364e;

    public k(q qVar, String str, t0 t0Var, int i10, String str2) {
        this.f35364e = qVar;
        this.f35360a = str;
        this.f35361b = t0Var;
        this.f35362c = i10;
        this.f35363d = str2;
    }

    @Override // xyz.stream.api.e
    public final void a(String str) {
        this.f35364e.d(this.f35360a, (p) this.f35361b.f25330b, null);
    }

    @Override // xyz.stream.api.e
    public final void onSuccess(Object obj) {
        BaseEntity baseEntity = (BaseEntity) obj;
        t0 t0Var = this.f35361b;
        String str = this.f35360a;
        q qVar = this.f35364e;
        List list = null;
        try {
            qVar.getClass();
            if (baseEntity != null && baseEntity.getCode() == 200) {
                JsonElement data = baseEntity.getData();
                JsonObject asJsonObject = (data == null || !data.isJsonObject()) ? null : data.getAsJsonObject();
                JsonElement jsonElement = asJsonObject != null ? asJsonObject.get("list") : null;
                if (jsonElement != null && !jsonElement.isJsonNull()) {
                    list = (List) xyz.stream.utils.m.f36162a.fromJson(jsonElement, new EpgManager$3().getType());
                }
            }
            qVar.d(str, (p) t0Var.f25330b, list);
            if (list == null || list.isEmpty()) {
                return;
            }
            qVar.f35377a.execute(new j(qVar, this.f35362c, this.f35363d, list));
        } catch (Exception e10) {
            u.a.g(e10, new StringBuilder("getEpgDataFromServer parse error: "));
            qVar.d(str, (p) t0Var.f25330b, null);
        }
    }
}
