package com.strmr.ps.data.local.dao;

import android.database.Cursor;
import android.os.CancellationSignal;
import androidx.media3.extractor.text.ttml.TtmlNode;
import androidx.room.RoomDatabase;
import com.strmr.ps.data.local.dao.TraktUserItemDao;
import com.strmr.ps.data.local.entity.TraktUserItem;
import defpackage.e6a;
import defpackage.ej;
import defpackage.mk1;
import defpackage.ms5;
import defpackage.n58;
import defpackage.ne9;
import defpackage.oq8;
import defpackage.p58;
import defpackage.pe9;
import defpackage.rq6;
import defpackage.sp1;
import defpackage.vo6;
import defpackage.vw2;
import defpackage.xm2;
import defpackage.yn1;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import kotlin.coroutines.Continuation;

/* JADX INFO: loaded from: classes3.dex */
public final class TraktUserItemDao_Impl implements TraktUserItemDao {
    private final RoomDatabase __db;
    private final xm2<TraktUserItem> __insertionAdapterOfTraktUserItem;
    private final oq8 __preparedStmtOfClearAll;
    private final oq8 __preparedStmtOfClearList;
    private final oq8 __preparedStmtOfClearListByType;
    private final oq8 __preparedStmtOfDeleteByTmdbId;

    public TraktUserItemDao_Impl(@vo6 RoomDatabase roomDatabase) {
        this.__db = roomDatabase;
        this.__insertionAdapterOfTraktUserItem = new xm2<TraktUserItem>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.1
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `trakt_user_items` (`id`,`userSlug`,`listType`,`itemType`,`traktId`,`tmdbId`,`slug`,`title`,`year`,`updatedAt`,`listedAt`,`collectedAt`,`watchedAt`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
            }

            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 TraktUserItem traktUserItem) {
                pe9Var.bindString(1, traktUserItem.getId());
                pe9Var.bindString(2, traktUserItem.getUserSlug());
                pe9Var.bindString(3, traktUserItem.getListType());
                pe9Var.bindString(4, traktUserItem.getItemType());
                if (traktUserItem.getTraktId() == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindLong(5, traktUserItem.getTraktId().intValue());
                }
                if (traktUserItem.getTmdbId() == null) {
                    pe9Var.bindNull(6);
                } else {
                    pe9Var.bindLong(6, traktUserItem.getTmdbId().intValue());
                }
                if (traktUserItem.getSlug() == null) {
                    pe9Var.bindNull(7);
                } else {
                    pe9Var.bindString(7, traktUserItem.getSlug());
                }
                if (traktUserItem.getTitle() == null) {
                    pe9Var.bindNull(8);
                } else {
                    pe9Var.bindString(8, traktUserItem.getTitle());
                }
                if (traktUserItem.getYear() == null) {
                    pe9Var.bindNull(9);
                } else {
                    pe9Var.bindString(9, traktUserItem.getYear());
                }
                pe9Var.bindLong(10, traktUserItem.getUpdatedAt());
                if (traktUserItem.getListedAt() == null) {
                    pe9Var.bindNull(11);
                } else {
                    pe9Var.bindLong(11, traktUserItem.getListedAt().longValue());
                }
                if (traktUserItem.getCollectedAt() == null) {
                    pe9Var.bindNull(12);
                } else {
                    pe9Var.bindLong(12, traktUserItem.getCollectedAt().longValue());
                }
                if (traktUserItem.getWatchedAt() == null) {
                    pe9Var.bindNull(13);
                } else {
                    pe9Var.bindLong(13, traktUserItem.getWatchedAt().longValue());
                }
            }
        };
        this.__preparedStmtOfClearList = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.2
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM trakt_user_items WHERE listType = ? AND userSlug = ?";
            }
        };
        this.__preparedStmtOfClearListByType = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.3
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM trakt_user_items WHERE listType = ? AND itemType = ? AND userSlug = ?";
            }
        };
        this.__preparedStmtOfClearAll = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.4
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM trakt_user_items";
            }
        };
        this.__preparedStmtOfDeleteByTmdbId = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.5
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM trakt_user_items WHERE tmdbId = ? AND listType = ? AND userSlug = ?";
            }
        };
    }

    /* JADX INFO: Access modifiers changed from: private */
    public TraktUserItem __entityCursorConverter_comStrmrPsDataLocalEntityTraktUserItem(@vo6 Cursor cursor) {
        int iA = yn1.a(cursor, TtmlNode.ATTR_ID);
        int iA2 = yn1.a(cursor, "userSlug");
        int iA3 = yn1.a(cursor, "listType");
        int iA4 = yn1.a(cursor, "itemType");
        int iA5 = yn1.a(cursor, "traktId");
        int iA6 = yn1.a(cursor, "tmdbId");
        int iA7 = yn1.a(cursor, "slug");
        int iA8 = yn1.a(cursor, "title");
        int iA9 = yn1.a(cursor, "year");
        int iA10 = yn1.a(cursor, "updatedAt");
        int iA11 = yn1.a(cursor, "listedAt");
        int iA12 = yn1.a(cursor, "collectedAt");
        int iA13 = yn1.a(cursor, "watchedAt");
        Long lValueOf = null;
        String string = iA == -1 ? null : cursor.getString(iA);
        String string2 = iA2 == -1 ? null : cursor.getString(iA2);
        String string3 = iA3 == -1 ? null : cursor.getString(iA3);
        String string4 = iA4 == -1 ? null : cursor.getString(iA4);
        Integer numValueOf = (iA5 == -1 || cursor.isNull(iA5)) ? null : Integer.valueOf(cursor.getInt(iA5));
        Integer numValueOf2 = (iA6 == -1 || cursor.isNull(iA6)) ? null : Integer.valueOf(cursor.getInt(iA6));
        String string5 = (iA7 == -1 || cursor.isNull(iA7)) ? null : cursor.getString(iA7);
        String string6 = (iA8 == -1 || cursor.isNull(iA8)) ? null : cursor.getString(iA8);
        String string7 = (iA9 == -1 || cursor.isNull(iA9)) ? null : cursor.getString(iA9);
        long j = iA10 == -1 ? 0L : cursor.getLong(iA10);
        Long lValueOf2 = (iA11 == -1 || cursor.isNull(iA11)) ? null : Long.valueOf(cursor.getLong(iA11));
        Long lValueOf3 = (iA12 == -1 || cursor.isNull(iA12)) ? null : Long.valueOf(cursor.getLong(iA12));
        if (iA13 != -1 && !cursor.isNull(iA13)) {
            lValueOf = Long.valueOf(cursor.getLong(iA13));
        }
        return new TraktUserItem(string, string2, string3, string4, numValueOf, numValueOf2, string5, string6, string7, j, lValueOf2, lValueOf3, lValueOf);
    }

    @vo6
    public static List<Class<?>> getRequiredConverters() {
        return Collections.EMPTY_LIST;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ Object lambda$replaceList$0(String str, String str2, List list, Continuation continuation) {
        return TraktUserItemDao.DefaultImpls.replaceList(this, str, str2, list, continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ Object lambda$replaceListByType$1(String str, String str2, String str3, List list, Continuation continuation) {
        return TraktUserItemDao.DefaultImpls.replaceListByType(this, str, str2, str3, list, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object clearAll(Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.9
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = TraktUserItemDao_Impl.this.__preparedStmtOfClearAll.acquire();
                try {
                    TraktUserItemDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        TraktUserItemDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        TraktUserItemDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    TraktUserItemDao_Impl.this.__preparedStmtOfClearAll.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object clearList(final String str, final String str2, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.7
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = TraktUserItemDao_Impl.this.__preparedStmtOfClearList.acquire();
                pe9VarAcquire.bindString(1, str);
                pe9VarAcquire.bindString(2, str2);
                try {
                    TraktUserItemDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        TraktUserItemDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        TraktUserItemDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    TraktUserItemDao_Impl.this.__preparedStmtOfClearList.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object clearListByType(final String str, final String str2, final String str3, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.8
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = TraktUserItemDao_Impl.this.__preparedStmtOfClearListByType.acquire();
                pe9VarAcquire.bindString(1, str);
                pe9VarAcquire.bindString(2, str2);
                pe9VarAcquire.bindString(3, str3);
                try {
                    TraktUserItemDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        TraktUserItemDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        TraktUserItemDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    TraktUserItemDao_Impl.this.__preparedStmtOfClearListByType.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object countAllItems(String str, Continuation<? super Integer> continuation) {
        final p58 p58VarD = p58.d(1, "SELECT COUNT(*) FROM trakt_user_items WHERE userSlug = ?");
        return mk1.c(this.__db, false, vw2.f(p58VarD, 1, str), new Callable<Integer>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.15
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Integer call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    int iValueOf = cursorB.moveToFirst() ? Integer.valueOf(cursorB.getInt(0)) : 0;
                    cursorB.close();
                    p58VarD.release();
                    return iValueOf;
                } catch (Throwable th) {
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object countByList(String str, String str2, Continuation<? super Integer> continuation) {
        final p58 p58VarD = p58.d(2, "SELECT COUNT(*) FROM trakt_user_items WHERE listType = ? AND userSlug = ?");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<Integer>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.11
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Integer call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    int iValueOf = cursorB.moveToFirst() ? Integer.valueOf(cursorB.getInt(0)) : 0;
                    cursorB.close();
                    p58VarD.release();
                    return iValueOf;
                } catch (Throwable th) {
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object countItems(String str, String str2, String str3, Continuation<? super Integer> continuation) {
        final p58 p58VarD = p58.d(3, "\n        SELECT COUNT(*) FROM trakt_user_items\n        WHERE listType = ? AND itemType = ? AND userSlug = ?\n    ");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        p58VarD.bindString(3, str3);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<Integer>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.14
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Integer call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    int iValueOf = cursorB.moveToFirst() ? Integer.valueOf(cursorB.getInt(0)) : 0;
                    cursorB.close();
                    p58VarD.release();
                    return iValueOf;
                } catch (Throwable th) {
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object deleteByTmdbId(final int i, final String str, final String str2, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.10
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = TraktUserItemDao_Impl.this.__preparedStmtOfDeleteByTmdbId.acquire();
                pe9VarAcquire.bindLong(1, i);
                pe9VarAcquire.bindString(2, str);
                pe9VarAcquire.bindString(3, str2);
                try {
                    TraktUserItemDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        TraktUserItemDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        TraktUserItemDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    TraktUserItemDao_Impl.this.__preparedStmtOfDeleteByTmdbId.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object existsByTmdbId(int i, String str, String str2, Continuation<? super Boolean> continuation) {
        final p58 p58VarD = p58.d(3, "\n        SELECT EXISTS(\n            SELECT 1 FROM trakt_user_items\n            WHERE tmdbId = ? AND listType = ? AND userSlug = ?\n        )\n    ");
        p58VarD.bindLong(1, i);
        p58VarD.bindString(2, str);
        p58VarD.bindString(3, str2);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<Boolean>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.17
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Boolean call() throws Exception {
                Boolean boolValueOf;
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    if (cursorB.moveToFirst()) {
                        boolValueOf = Boolean.valueOf(cursorB.getInt(0) != 0);
                    } else {
                        boolValueOf = Boolean.FALSE;
                    }
                    cursorB.close();
                    p58VarD.release();
                    return boolValueOf;
                } catch (Throwable th) {
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object findByTmdbId(int i, String str, String str2, String str3, Continuation<? super TraktUserItem> continuation) {
        final p58 p58VarD = p58.d(4, "\n        SELECT * FROM trakt_user_items\n        WHERE tmdbId = ? AND listType = ? AND itemType = ? AND userSlug = ?\n        LIMIT 1\n    ");
        p58VarD.bindLong(1, i);
        p58VarD.bindString(2, str);
        p58VarD.bindString(3, str2);
        p58VarD.bindString(4, str3);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<TraktUserItem>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.16
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @rq6
            public TraktUserItem call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    int iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                    int iB2 = yn1.b(cursorB, "userSlug");
                    int iB3 = yn1.b(cursorB, "listType");
                    int iB4 = yn1.b(cursorB, "itemType");
                    int iB5 = yn1.b(cursorB, "traktId");
                    int iB6 = yn1.b(cursorB, "tmdbId");
                    int iB7 = yn1.b(cursorB, "slug");
                    int iB8 = yn1.b(cursorB, "title");
                    int iB9 = yn1.b(cursorB, "year");
                    int iB10 = yn1.b(cursorB, "updatedAt");
                    int iB11 = yn1.b(cursorB, "listedAt");
                    int iB12 = yn1.b(cursorB, "collectedAt");
                    int iB13 = yn1.b(cursorB, "watchedAt");
                    TraktUserItem traktUserItem = null;
                    if (cursorB.moveToFirst()) {
                        traktUserItem = new TraktUserItem(cursorB.getString(iB), cursorB.getString(iB2), cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : Integer.valueOf(cursorB.getInt(iB5)), cursorB.isNull(iB6) ? null : Integer.valueOf(cursorB.getInt(iB6)), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.isNull(iB9) ? null : cursorB.getString(iB9), cursorB.getLong(iB10), cursorB.isNull(iB11) ? null : Long.valueOf(cursorB.getLong(iB11)), cursorB.isNull(iB12) ? null : Long.valueOf(cursorB.getLong(iB12)), cursorB.isNull(iB13) ? null : Long.valueOf(cursorB.getLong(iB13)));
                    }
                    return traktUserItem;
                } finally {
                    cursorB.close();
                    p58VarD.release();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getAllTmdbIdsInList(String str, String str2, Continuation<? super List<Integer>> continuation) {
        final p58 p58VarD = p58.d(2, "SELECT tmdbId FROM trakt_user_items WHERE listType = ? AND userSlug = ? AND tmdbId IS NOT NULL");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<List<Integer>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.20
            @Override // java.util.concurrent.Callable
            @vo6
            public List<Integer> call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(Integer.valueOf(cursorB.getInt(0)));
                    }
                    return arrayList;
                } finally {
                    cursorB.close();
                    p58VarD.release();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getHistoryPaged(String str, int i, int i2, Continuation<? super List<TraktUserItem>> continuation) {
        final p58 p58VarD = p58.d(3, "\n        SELECT * FROM trakt_user_items\n        WHERE listType = 'HISTORY' AND userSlug = ?\n        ORDER BY watchedAt DESC\n        LIMIT ? OFFSET ?\n    ");
        p58VarD.bindString(1, str);
        p58VarD.bindLong(2, i);
        return mk1.c(this.__db, false, vw2.e(p58VarD, 3, i2), new Callable<List<TraktUserItem>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.18
            @Override // java.util.concurrent.Callable
            @vo6
            public List<TraktUserItem> call() throws Exception {
                int iB;
                int iB2;
                int iB3;
                int iB4;
                int iB5;
                int iB6;
                int iB7;
                int iB8;
                int iB9;
                int iB10;
                int iB11;
                int iB12;
                int iB13;
                AnonymousClass18 anonymousClass18 = this;
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                    iB2 = yn1.b(cursorB, "userSlug");
                    iB3 = yn1.b(cursorB, "listType");
                    iB4 = yn1.b(cursorB, "itemType");
                    iB5 = yn1.b(cursorB, "traktId");
                    iB6 = yn1.b(cursorB, "tmdbId");
                    iB7 = yn1.b(cursorB, "slug");
                    iB8 = yn1.b(cursorB, "title");
                    iB9 = yn1.b(cursorB, "year");
                    iB10 = yn1.b(cursorB, "updatedAt");
                    iB11 = yn1.b(cursorB, "listedAt");
                    iB12 = yn1.b(cursorB, "collectedAt");
                    iB13 = yn1.b(cursorB, "watchedAt");
                } catch (Throwable th) {
                    th = th;
                }
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(new TraktUserItem(cursorB.getString(iB), cursorB.getString(iB2), cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : Integer.valueOf(cursorB.getInt(iB5)), cursorB.isNull(iB6) ? null : Integer.valueOf(cursorB.getInt(iB6)), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.isNull(iB9) ? null : cursorB.getString(iB9), cursorB.getLong(iB10), cursorB.isNull(iB11) ? null : Long.valueOf(cursorB.getLong(iB11)), cursorB.isNull(iB12) ? null : Long.valueOf(cursorB.getLong(iB12)), cursorB.isNull(iB13) ? null : Long.valueOf(cursorB.getLong(iB13))));
                    }
                    cursorB.close();
                    p58VarD.release();
                    return arrayList;
                } catch (Throwable th2) {
                    th = th2;
                    anonymousClass18 = this;
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getHistoryPagedByType(String str, String str2, int i, int i2, Continuation<? super List<TraktUserItem>> continuation) {
        final p58 p58VarD = p58.d(4, "\n        SELECT * FROM trakt_user_items\n        WHERE listType = 'HISTORY' AND itemType = ? AND userSlug = ?\n        ORDER BY watchedAt DESC\n        LIMIT ? OFFSET ?\n    ");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        p58VarD.bindLong(3, i);
        return mk1.c(this.__db, false, vw2.e(p58VarD, 4, i2), new Callable<List<TraktUserItem>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.19
            @Override // java.util.concurrent.Callable
            @vo6
            public List<TraktUserItem> call() throws Exception {
                int iB;
                int iB2;
                int iB3;
                int iB4;
                int iB5;
                int iB6;
                int iB7;
                int iB8;
                int iB9;
                int iB10;
                int iB11;
                int iB12;
                int iB13;
                AnonymousClass19 anonymousClass19 = this;
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                    iB2 = yn1.b(cursorB, "userSlug");
                    iB3 = yn1.b(cursorB, "listType");
                    iB4 = yn1.b(cursorB, "itemType");
                    iB5 = yn1.b(cursorB, "traktId");
                    iB6 = yn1.b(cursorB, "tmdbId");
                    iB7 = yn1.b(cursorB, "slug");
                    iB8 = yn1.b(cursorB, "title");
                    iB9 = yn1.b(cursorB, "year");
                    iB10 = yn1.b(cursorB, "updatedAt");
                    iB11 = yn1.b(cursorB, "listedAt");
                    iB12 = yn1.b(cursorB, "collectedAt");
                    iB13 = yn1.b(cursorB, "watchedAt");
                } catch (Throwable th) {
                    th = th;
                }
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(new TraktUserItem(cursorB.getString(iB), cursorB.getString(iB2), cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : Integer.valueOf(cursorB.getInt(iB5)), cursorB.isNull(iB6) ? null : Integer.valueOf(cursorB.getInt(iB6)), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.isNull(iB9) ? null : cursorB.getString(iB9), cursorB.getLong(iB10), cursorB.isNull(iB11) ? null : Long.valueOf(cursorB.getLong(iB11)), cursorB.isNull(iB12) ? null : Long.valueOf(cursorB.getLong(iB12)), cursorB.isNull(iB13) ? null : Long.valueOf(cursorB.getLong(iB13))));
                    }
                    cursorB.close();
                    p58VarD.release();
                    return arrayList;
                } catch (Throwable th2) {
                    th = th2;
                    anonymousClass19 = this;
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getHistoryPagedByTypeSorted(String str, String str2, String str3, String str4, int i, int i2, Continuation<? super List<TraktUserItem>> continuation) {
        return TraktUserItemDao.DefaultImpls.getHistoryPagedByTypeSorted(this, str, str2, str3, str4, i, i2, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getHistoryPagedSorted(String str, String str2, String str3, int i, int i2, Continuation<? super List<TraktUserItem>> continuation) {
        return TraktUserItemDao.DefaultImpls.getHistoryPagedSorted(this, str, str2, str3, i, i2, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getItems(String str, String str2, String str3, Continuation<? super List<TraktUserItem>> continuation) {
        final p58 p58VarD = p58.d(3, "\n        SELECT * FROM trakt_user_items\n        WHERE listType = ? AND itemType = ? AND userSlug = ?\n        ORDER BY updatedAt DESC\n    ");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        p58VarD.bindString(3, str3);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<List<TraktUserItem>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.12
            @Override // java.util.concurrent.Callable
            @vo6
            public List<TraktUserItem> call() throws Exception {
                int iB;
                int iB2;
                int iB3;
                int iB4;
                int iB5;
                int iB6;
                int iB7;
                int iB8;
                int iB9;
                int iB10;
                int iB11;
                int iB12;
                int iB13;
                AnonymousClass12 anonymousClass12 = this;
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                    iB2 = yn1.b(cursorB, "userSlug");
                    iB3 = yn1.b(cursorB, "listType");
                    iB4 = yn1.b(cursorB, "itemType");
                    iB5 = yn1.b(cursorB, "traktId");
                    iB6 = yn1.b(cursorB, "tmdbId");
                    iB7 = yn1.b(cursorB, "slug");
                    iB8 = yn1.b(cursorB, "title");
                    iB9 = yn1.b(cursorB, "year");
                    iB10 = yn1.b(cursorB, "updatedAt");
                    iB11 = yn1.b(cursorB, "listedAt");
                    iB12 = yn1.b(cursorB, "collectedAt");
                    iB13 = yn1.b(cursorB, "watchedAt");
                } catch (Throwable th) {
                    th = th;
                }
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(new TraktUserItem(cursorB.getString(iB), cursorB.getString(iB2), cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : Integer.valueOf(cursorB.getInt(iB5)), cursorB.isNull(iB6) ? null : Integer.valueOf(cursorB.getInt(iB6)), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.isNull(iB9) ? null : cursorB.getString(iB9), cursorB.getLong(iB10), cursorB.isNull(iB11) ? null : Long.valueOf(cursorB.getLong(iB11)), cursorB.isNull(iB12) ? null : Long.valueOf(cursorB.getLong(iB12)), cursorB.isNull(iB13) ? null : Long.valueOf(cursorB.getLong(iB13))));
                    }
                    cursorB.close();
                    p58VarD.release();
                    return arrayList;
                } catch (Throwable th2) {
                    th = th2;
                    anonymousClass12 = this;
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getItemsPaged(String str, String str2, String str3, int i, int i2, Continuation<? super List<TraktUserItem>> continuation) {
        final p58 p58VarD = p58.d(5, "\n        SELECT * FROM trakt_user_items\n        WHERE listType = ? AND itemType = ? AND userSlug = ?\n        ORDER BY updatedAt DESC\n        LIMIT ? OFFSET ?\n    ");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        p58VarD.bindString(3, str3);
        p58VarD.bindLong(4, i);
        return mk1.c(this.__db, false, vw2.e(p58VarD, 5, i2), new Callable<List<TraktUserItem>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.13
            @Override // java.util.concurrent.Callable
            @vo6
            public List<TraktUserItem> call() throws Exception {
                int iB;
                int iB2;
                int iB3;
                int iB4;
                int iB5;
                int iB6;
                int iB7;
                int iB8;
                int iB9;
                int iB10;
                int iB11;
                int iB12;
                int iB13;
                AnonymousClass13 anonymousClass13 = this;
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                    iB2 = yn1.b(cursorB, "userSlug");
                    iB3 = yn1.b(cursorB, "listType");
                    iB4 = yn1.b(cursorB, "itemType");
                    iB5 = yn1.b(cursorB, "traktId");
                    iB6 = yn1.b(cursorB, "tmdbId");
                    iB7 = yn1.b(cursorB, "slug");
                    iB8 = yn1.b(cursorB, "title");
                    iB9 = yn1.b(cursorB, "year");
                    iB10 = yn1.b(cursorB, "updatedAt");
                    iB11 = yn1.b(cursorB, "listedAt");
                    iB12 = yn1.b(cursorB, "collectedAt");
                    iB13 = yn1.b(cursorB, "watchedAt");
                } catch (Throwable th) {
                    th = th;
                }
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(new TraktUserItem(cursorB.getString(iB), cursorB.getString(iB2), cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : Integer.valueOf(cursorB.getInt(iB5)), cursorB.isNull(iB6) ? null : Integer.valueOf(cursorB.getInt(iB6)), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.isNull(iB9) ? null : cursorB.getString(iB9), cursorB.getLong(iB10), cursorB.isNull(iB11) ? null : Long.valueOf(cursorB.getLong(iB11)), cursorB.isNull(iB12) ? null : Long.valueOf(cursorB.getLong(iB12)), cursorB.isNull(iB13) ? null : Long.valueOf(cursorB.getLong(iB13))));
                    }
                    cursorB.close();
                    p58VarD.release();
                    return arrayList;
                } catch (Throwable th2) {
                    th = th2;
                    anonymousClass13 = this;
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getItemsPagedSorted(String str, String str2, String str3, String str4, String str5, int i, int i2, Continuation<? super List<TraktUserItem>> continuation) {
        return TraktUserItemDao.DefaultImpls.getItemsPagedSorted(this, str, str2, str3, str4, str5, i, i2, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getItemsRaw(final ne9 ne9Var, Continuation<? super List<TraktUserItem>> continuation) {
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<List<TraktUserItem>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.22
            @Override // java.util.concurrent.Callable
            @vo6
            public List<TraktUserItem> call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, ne9Var, false);
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(TraktUserItemDao_Impl.this.__entityCursorConverter_comStrmrPsDataLocalEntityTraktUserItem(cursorB));
                    }
                    return arrayList;
                } finally {
                    cursorB.close();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object getTmdbIdsByListAndType(String str, String str2, String str3, Continuation<? super List<Integer>> continuation) {
        final p58 p58VarD = p58.d(3, "\n        SELECT tmdbId FROM trakt_user_items\n        WHERE listType = ? AND itemType = ? AND userSlug = ? AND tmdbId IS NOT NULL\n    ");
        p58VarD.bindString(1, str);
        p58VarD.bindString(2, str2);
        p58VarD.bindString(3, str3);
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<List<Integer>>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.21
            @Override // java.util.concurrent.Callable
            @vo6
            public List<Integer> call() throws Exception {
                Cursor cursorB = sp1.b(TraktUserItemDao_Impl.this.__db, p58VarD, false);
                try {
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(Integer.valueOf(cursorB.getInt(0)));
                    }
                    return arrayList;
                } finally {
                    cursorB.close();
                    p58VarD.release();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object insertAll(final List<TraktUserItem> list, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.TraktUserItemDao_Impl.6
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                TraktUserItemDao_Impl.this.__db.beginTransaction();
                try {
                    TraktUserItemDao_Impl.this.__insertionAdapterOfTraktUserItem.insert((Iterable) list);
                    TraktUserItemDao_Impl.this.__db.setTransactionSuccessful();
                    return e6a.a;
                } finally {
                    TraktUserItemDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object replaceList(String str, String str2, List<TraktUserItem> list, Continuation<? super e6a> continuation) {
        return n58.a(this.__db, new ej(this, str, str2, list, 3), continuation);
    }

    @Override // com.strmr.ps.data.local.dao.TraktUserItemDao
    public Object replaceListByType(String str, String str2, String str3, List<TraktUserItem> list, Continuation<? super e6a> continuation) {
        return n58.a(this.__db, new ms5(this, str, str2, str3, list), continuation);
    }
}
