package vf;

import com.pichillilorenzo.flutter_inappwebview_android.credential_database.URLCredentialContract;
import java.util.ArrayList;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
import xyz.stream.api.database.entity.EpgEntity;
import xyz.stream.api.database.entity.ServerEntity;
import xyz.stream.download.config.InnerConstant;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class c implements sd.l {

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

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

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

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

    public /* synthetic */ c(int i10, String str, String str2) {
        this.f33958a = 0;
        this.f33960c = i10;
        this.f33959b = str;
        this.f33961d = str2;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // sd.l
    public final Object invoke(Object obj) throws Exception {
        k3.c cVarJ;
        int i10 = this.f33958a;
        String str = this.f33961d;
        String str2 = this.f33959b;
        int i11 = this.f33960c;
        switch (i10) {
            case 0:
                cVarJ = ((k3.a) obj).J("SELECT * FROM epg_entity WHERE channel_id = ? AND date = ? AND language= ? ORDER BY start_time ASC");
                try {
                    cVarJ.a(1, i11);
                    if (str2 == null) {
                        cVarJ.d(2);
                    } else {
                        cVarJ.s(2, str2);
                    }
                    if (str == null) {
                        cVarJ.d(3);
                    } else {
                        cVarJ.s(3, str);
                    }
                    int iC = androidx.room.util.f.c(cVarJ, "epg_id");
                    int iC2 = androidx.room.util.f.c(cVarJ, "uni_key");
                    int iC3 = androidx.room.util.f.c(cVarJ, IjkMediaMeta.IJKM_KEY_TITLE);
                    int iC4 = androidx.room.util.f.c(cVarJ, "description");
                    int iC5 = androidx.room.util.f.c(cVarJ, "start_time");
                    int iC6 = androidx.room.util.f.c(cVarJ, "end_time");
                    int iC7 = androidx.room.util.f.c(cVarJ, "channel_id");
                    int iC8 = androidx.room.util.f.c(cVarJ, "date");
                    int iC9 = androidx.room.util.f.c(cVarJ, IjkMediaMeta.IJKM_KEY_LANGUAGE);
                    ArrayList arrayList = new ArrayList();
                    while (cVarJ.G()) {
                        arrayList.add(new EpgEntity(cVarJ.isNull(iC2) ? null : cVarJ.A(iC2), cVarJ.isNull(iC) ? null : Integer.valueOf((int) cVarJ.getLong(iC)), cVarJ.isNull(iC3) ? null : cVarJ.A(iC3), cVarJ.isNull(iC4) ? null : cVarJ.A(iC4), cVarJ.isNull(iC5) ? null : cVarJ.A(iC5), cVarJ.isNull(iC6) ? null : cVarJ.A(iC6), cVarJ.isNull(iC7) ? null : Integer.valueOf((int) cVarJ.getLong(iC7)), cVarJ.isNull(iC8) ? null : cVarJ.A(iC8), cVarJ.isNull(iC9) ? null : cVarJ.A(iC9)));
                        break;
                    }
                    cVarJ.close();
                    return arrayList;
                } finally {
                }
            default:
                cVarJ = ((k3.a) obj).J("SELECT * FROM server_entity WHERE server_name = ? AND server_type = ? AND root_path = ?");
                try {
                    if (str2 == null) {
                        cVarJ.d(1);
                    } else {
                        cVarJ.s(1, str2);
                    }
                    cVarJ.a(2, i11);
                    if (str == null) {
                        cVarJ.d(3);
                    } else {
                        cVarJ.s(3, str);
                    }
                    int iC10 = androidx.room.util.f.c(cVarJ, InnerConstant.Db.f36069id);
                    int iC11 = androidx.room.util.f.c(cVarJ, "server_name");
                    int iC12 = androidx.room.util.f.c(cVarJ, "update_at");
                    int iC13 = androidx.room.util.f.c(cVarJ, "create_at");
                    int iC14 = androidx.room.util.f.c(cVarJ, "root_path");
                    int iC15 = androidx.room.util.f.c(cVarJ, "base_url");
                    int iC16 = androidx.room.util.f.c(cVarJ, URLCredentialContract.FeedEntry.COLUMN_NAME_USERNAME);
                    int iC17 = androidx.room.util.f.c(cVarJ, URLCredentialContract.FeedEntry.COLUMN_NAME_PASSWORD);
                    int iC18 = androidx.room.util.f.c(cVarJ, "server_type");
                    int iC19 = androidx.room.util.f.c(cVarJ, "path_id");
                    int iC20 = androidx.room.util.f.c(cVarJ, "visible");
                    if (cVarJ.G()) {
                        serverEntity = new ServerEntity((cVarJ.isNull(iC10) ? null : Integer.valueOf((int) cVarJ.getLong(iC10))).intValue(), cVarJ.isNull(iC11) ? null : cVarJ.A(iC11), cVarJ.isNull(iC12) ? null : Integer.valueOf((int) cVarJ.getLong(iC12)), cVarJ.isNull(iC13) ? null : Integer.valueOf((int) cVarJ.getLong(iC13)), cVarJ.isNull(iC14) ? null : cVarJ.A(iC14), cVarJ.isNull(iC15) ? null : cVarJ.A(iC15), cVarJ.isNull(iC16) ? null : cVarJ.A(iC16), cVarJ.isNull(iC17) ? null : cVarJ.A(iC17), cVarJ.isNull(iC18) ? null : Integer.valueOf((int) cVarJ.getLong(iC18)), cVarJ.isNull(iC19) ? null : cVarJ.A(iC19), cVarJ.isNull(iC20) ? null : Integer.valueOf((int) cVarJ.getLong(iC20)));
                        break;
                    }
                    cVarJ.close();
                    return serverEntity;
                } finally {
                }
        }
    }

    public /* synthetic */ c(String str, String str2) {
        this.f33958a = 1;
        this.f33959b = str;
        this.f33960c = 10;
        this.f33961d = str2;
    }
}
