package X6;

import c5.C0583b;
import d5.AbstractC0844a;
import java.util.ArrayList;
import n4.u0;

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

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

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

    public /* synthetic */ f(int i, String str) {
        this.f7249q = i;
        this.f7250r = str;
    }

    @Override // O6.l
    public final Object b(Object obj) throws Exception {
        switch (this.f7249q) {
            case u0.f15495q /* 0 */:
                String str = (String) obj;
                P6.g.e(str, "it");
                boolean zV = e.V(str);
                String str2 = this.f7250r;
                return zV ? str.length() < str2.length() ? str2 : str : AbstractC0844a.l(str2, str);
            default:
                String str3 = this.f7250r;
                X1.a aVar = (X1.a) obj;
                P6.g.e(aVar, "_connection");
                X1.c cVarH0 = aVar.h0("SELECT * FROM tbl_history WHERE view_date LIKE ? ORDER BY movie_id DESC LIMIT ? OFFSET ?");
                try {
                    cVarH0.s(1, str3);
                    cVarH0.e(30, 2);
                    cVarH0.e(0, 3);
                    int iN = s7.l.n(cVarH0, "movie_id");
                    int iN2 = s7.l.n(cVarH0, "title");
                    int iN3 = s7.l.n(cVarH0, "type");
                    int iN4 = s7.l.n(cVarH0, "poster_url");
                    int iN5 = s7.l.n(cVarH0, "backdrop_url");
                    int iN6 = s7.l.n(cVarH0, "release_date");
                    int iN7 = s7.l.n(cVarH0, "countries");
                    int iN8 = s7.l.n(cVarH0, "genres");
                    int iN9 = s7.l.n(cVarH0, "view_date");
                    int iN10 = s7.l.n(cVarH0, "overview");
                    ArrayList arrayList = new ArrayList();
                    while (cVarH0.W()) {
                        arrayList.add(new C0583b(cVarH0.q(iN), cVarH0.o(iN2), cVarH0.o(iN3), cVarH0.o(iN4), cVarH0.o(iN5), cVarH0.o(iN6), cVarH0.o(iN7), cVarH0.o(iN8), cVarH0.o(iN9), cVarH0.o(iN10)));
                        break;
                    }
                    return arrayList;
                } finally {
                    cVarH0.close();
                }
        }
    }
}
