package B6;

import B0.I;
import a5.C0404c;
import android.widget.TextView;
import b5.C0543d;
import c5.C0582a;
import com.google.android.gms.internal.measurement.C1;
import com.martsnew.data.model.response.MovieResponse;
import com.martsnew.tv.ui.player.TvPlayerActivity;
import d5.AbstractC0844a;
import java.util.ArrayList;
import n4.u0;
import u5.P0;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class a implements O6.l {

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

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final /* synthetic */ Object f1015r;

    public /* synthetic */ a(int i, Object obj) {
        this.f1014q = i;
        this.f1015r = obj;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // O6.l
    public final Object b(Object obj) throws Exception {
        int i;
        int i5;
        Integer numValueOf;
        Object objJ;
        A6.n nVar = A6.n.f457a;
        Object obj2 = this.f1015r;
        switch (this.f1014q) {
            case u0.f15495q /* 0 */:
                return obj == ((e) obj2) ? "(this Collection)" : String.valueOf(obj);
            case 1:
                Y1.a aVar = (Y1.a) obj;
                P6.g.e(aVar, "db");
                ((O1.w) obj2).f5085g = aVar;
                return nVar;
            case 2:
                long jLongValue = ((Long) obj).longValue();
                int i8 = TvPlayerActivity.f11193a0;
                TvPlayerActivity tvPlayerActivity = (TvPlayerActivity) obj2;
                O3.e eVar = (O3.e) tvPlayerActivity.W();
                eVar.getClass();
                eVar.z(((I) eVar).L(), jLongValue, false);
                tvPlayerActivity.U();
                return nVar;
            case 3:
                String str = (String) obj;
                P6.g.e(str, "it");
                P0 p02 = (P0) obj2;
                String strL = AbstractC0844a.l(p02.f17641P.getText().toString(), str);
                TextView textView = p02.f17641P;
                CharSequence text = textView.getText();
                P6.g.d(text, "getText(...)");
                if (text.length() > 0 || strL.length() > 0) {
                    textView.setText(strL);
                }
                return nVar;
            case 4:
                C0543d c0543d = (C0543d) obj2;
                X1.a aVar2 = (X1.a) obj;
                P6.g.e(aVar2, "_connection");
                X1.c cVarH0 = aVar2.h0("SELECT * FROM tbl_continue ORDER BY updated_at DESC LIMIT 20");
                try {
                    int iN = s7.l.n(cVarH0, "id");
                    int iN2 = s7.l.n(cVarH0, "user_id");
                    int iN3 = s7.l.n(cVarH0, "movie_id");
                    int iN4 = s7.l.n(cVarH0, "season_id");
                    int iN5 = s7.l.n(cVarH0, "episode_id");
                    int iN6 = s7.l.n(cVarH0, "season_number");
                    int iN7 = s7.l.n(cVarH0, "episode_number");
                    int iN8 = s7.l.n(cVarH0, "time");
                    int iN9 = s7.l.n(cVarH0, "percent");
                    int iN10 = s7.l.n(cVarH0, "status");
                    int iN11 = s7.l.n(cVarH0, "updated_at");
                    int iN12 = s7.l.n(cVarH0, "movie");
                    ArrayList arrayList = new ArrayList();
                    while (cVarH0.W()) {
                        long jQ = cVarH0.q(iN);
                        Object obj3 = null;
                        Long lValueOf = cVarH0.N(iN2) ? null : Long.valueOf(cVarH0.q(iN2));
                        Long lValueOf2 = cVarH0.N(iN3) ? null : Long.valueOf(cVarH0.q(iN3));
                        Long lValueOf3 = cVarH0.N(iN4) ? null : Long.valueOf(cVarH0.q(iN4));
                        Long lValueOf4 = cVarH0.N(iN5) ? null : Long.valueOf(cVarH0.q(iN5));
                        if (cVarH0.N(iN6)) {
                            i = iN;
                            i5 = iN2;
                            numValueOf = null;
                        } else {
                            i = iN;
                            i5 = iN2;
                            numValueOf = Integer.valueOf((int) cVarH0.q(iN6));
                        }
                        Integer numValueOf2 = cVarH0.N(iN7) ? null : Integer.valueOf((int) cVarH0.q(iN7));
                        Long lValueOf5 = cVarH0.N(iN8) ? null : Long.valueOf(cVarH0.q(iN8));
                        Double dValueOf = cVarH0.N(iN9) ? null : Double.valueOf(cVarH0.b0(iN9));
                        Integer numValueOf3 = cVarH0.N(iN10) ? null : Integer.valueOf((int) cVarH0.q(iN10));
                        Long lValueOf6 = cVarH0.N(iN11) ? null : Long.valueOf(cVarH0.q(iN11));
                        String strO = cVarH0.N(iN12) ? null : cVarH0.o(iN12);
                        C0404c c0404c = (C0404c) c0543d.f9209c.getValue();
                        c0404c.getClass();
                        if (strO != null) {
                            try {
                                objJ = (MovieResponse) c0404c.f7618a.a(MovieResponse.class).a(strO);
                            } catch (Throwable th) {
                                objJ = C1.j(th);
                            }
                            if (!(objJ instanceof A6.i)) {
                                obj3 = objJ;
                            }
                            obj3 = (MovieResponse) obj3;
                        }
                        arrayList.add(new C0582a(jQ, lValueOf, lValueOf2, lValueOf3, lValueOf4, numValueOf, numValueOf2, lValueOf5, dValueOf, numValueOf3, lValueOf6, obj3));
                        iN = i;
                        iN2 = i5;
                        break;
                    }
                    return arrayList;
                } finally {
                    cVarH0.close();
                }
            default:
                ((h2.f) obj2).f13374A = true;
                return nVar;
        }
    }
}
