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.MediaDao;
import com.strmr.ps.data.local.entity.MediaEnrichmentEntity;
import defpackage.bt5;
import defpackage.e6a;
import defpackage.ej;
import defpackage.hj5;
import defpackage.j43;
import defpackage.js5;
import defpackage.mk1;
import defpackage.ms5;
import defpackage.n58;
import defpackage.nna;
import defpackage.ns5;
import defpackage.oq8;
import defpackage.os5;
import defpackage.p58;
import defpackage.pe9;
import defpackage.rq6;
import defpackage.rt5;
import defpackage.sp1;
import defpackage.st5;
import defpackage.vo6;
import defpackage.vw2;
import defpackage.wx7;
import defpackage.xm2;
import defpackage.yn1;
import defpackage.z79;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import kotlin.coroutines.Continuation;

/* JADX INFO: loaded from: classes3.dex */
public final class MediaDao_Impl implements MediaDao {
    private final RoomDatabase __db;
    private final xm2<js5> __insertionAdapterOfMediaContentEntity;
    private final xm2<MediaEnrichmentEntity> __insertionAdapterOfMediaEnrichmentEntity;
    private final xm2<os5> __insertionAdapterOfMediaImageEntity;
    private final xm2<bt5> __insertionAdapterOfMediaRatingEntity;
    private final xm2<nna> __insertionAdapterOfWatchProgressEntity;
    private final oq8 __preparedStmtOfClearCategory;
    private final oq8 __preparedStmtOfClearOldCache;
    private final oq8 __preparedStmtOfDeleteAllContent;
    private final oq8 __preparedStmtOfDeleteAllEnrichments;
    private final oq8 __preparedStmtOfDeleteAllImages;
    private final oq8 __preparedStmtOfDeleteAllRatings;
    private final oq8 __preparedStmtOfUpdateProgress;

    public MediaDao_Impl(@vo6 RoomDatabase roomDatabase) {
        this.__db = roomDatabase;
        this.__insertionAdapterOfMediaContentEntity = new xm2<js5>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.1
            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 js5 js5Var) {
                pe9Var.bindLong(1, js5Var.a);
                pe9Var.bindLong(2, js5Var.b);
                String str = js5Var.c;
                if (str == null) {
                    pe9Var.bindNull(3);
                } else {
                    pe9Var.bindString(3, str);
                }
                pe9Var.bindString(4, js5Var.d);
                String str2 = js5Var.e;
                if (str2 == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindString(5, str2);
                }
                String str3 = js5Var.f;
                if (str3 == null) {
                    pe9Var.bindNull(6);
                } else {
                    pe9Var.bindString(6, str3);
                }
                if (js5Var.g == null) {
                    pe9Var.bindNull(7);
                } else {
                    pe9Var.bindLong(7, r0.intValue());
                }
                String str4 = js5Var.h;
                if (str4 == null) {
                    pe9Var.bindNull(8);
                } else {
                    pe9Var.bindString(8, str4);
                }
                pe9Var.bindString(9, js5Var.i);
                pe9Var.bindString(10, js5Var.j);
                pe9Var.bindLong(11, js5Var.k);
                String str5 = js5Var.l;
                if (str5 == null) {
                    pe9Var.bindNull(12);
                } else {
                    pe9Var.bindString(12, str5);
                }
                String str6 = js5Var.m;
                if (str6 == null) {
                    pe9Var.bindNull(13);
                } else {
                    pe9Var.bindString(13, str6);
                }
                pe9Var.bindLong(14, js5Var.n);
            }

            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `media_content` (`id`,`tmdbId`,`imdbId`,`title`,`overview`,`year`,`runtime`,`certification`,`contentType`,`category`,`position`,`genres`,`cast`,`cachedAt`) VALUES (nullif(?, 0),?,?,?,?,?,?,?,?,?,?,?,?,?)";
            }
        };
        this.__insertionAdapterOfMediaImageEntity = new xm2<os5>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.2
            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 os5 os5Var) {
                pe9Var.bindLong(1, os5Var.a);
                pe9Var.bindLong(2, os5Var.b);
                String str = os5Var.c;
                if (str == null) {
                    pe9Var.bindNull(3);
                } else {
                    pe9Var.bindString(3, str);
                }
                String str2 = os5Var.d;
                if (str2 == null) {
                    pe9Var.bindNull(4);
                } else {
                    pe9Var.bindString(4, str2);
                }
                String str3 = os5Var.e;
                if (str3 == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindString(5, str3);
                }
            }

            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `media_images` (`id`,`tmdbId`,`posterUrl`,`backdropUrl`,`logoUrl`) VALUES (nullif(?, 0),?,?,?,?)";
            }
        };
        this.__insertionAdapterOfMediaRatingEntity = new xm2<bt5>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.3
            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 bt5 bt5Var) {
                pe9Var.bindLong(1, bt5Var.a);
                pe9Var.bindLong(2, bt5Var.b);
                if (bt5Var.c == null) {
                    pe9Var.bindNull(3);
                } else {
                    pe9Var.bindDouble(3, r0.floatValue());
                }
                if (bt5Var.d == null) {
                    pe9Var.bindNull(4);
                } else {
                    pe9Var.bindDouble(4, r0.floatValue());
                }
                if (bt5Var.e == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindDouble(5, r0.floatValue());
                }
                if (bt5Var.f == null) {
                    pe9Var.bindNull(6);
                } else {
                    pe9Var.bindLong(6, r0.intValue());
                }
                pe9Var.bindLong(7, bt5Var.g);
            }

            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `media_ratings` (`id`,`tmdbId`,`tmdbRating`,`imdbRating`,`traktRating`,`rottenTomatoesRating`,`updatedAt`) VALUES (nullif(?, 0),?,?,?,?,?,?)";
            }
        };
        this.__insertionAdapterOfWatchProgressEntity = new xm2<nna>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.4
            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 nna nnaVar) {
                pe9Var.bindLong(1, nnaVar.a);
                pe9Var.bindDouble(2, nnaVar.b);
                pe9Var.bindLong(3, nnaVar.c);
                if (nnaVar.d == null) {
                    pe9Var.bindNull(4);
                } else {
                    pe9Var.bindLong(4, r0.intValue());
                }
                if (nnaVar.e == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindLong(5, r0.intValue());
                }
                if (nnaVar.f == null) {
                    pe9Var.bindNull(6);
                } else {
                    pe9Var.bindLong(6, r6.intValue());
                }
            }

            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `watch_progress` (`tmdbId`,`progress`,`lastWatchedAt`,`episodeId`,`seasonNumber`,`episodeNumber`) VALUES (?,?,?,?,?,?)";
            }
        };
        this.__insertionAdapterOfMediaEnrichmentEntity = new xm2<MediaEnrichmentEntity>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.5
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `media_enrichment` (`tmdbId`,`posterUrl`,`backdropUrl`,`logoUrl`,`genres`,`cast`,`runtime`,`certification`,`lastUpdated`) VALUES (?,?,?,?,?,?,?,?,?)";
            }

            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 MediaEnrichmentEntity mediaEnrichmentEntity) {
                pe9Var.bindLong(1, mediaEnrichmentEntity.getTmdbId());
                if (mediaEnrichmentEntity.getPosterUrl() == null) {
                    pe9Var.bindNull(2);
                } else {
                    pe9Var.bindString(2, mediaEnrichmentEntity.getPosterUrl());
                }
                if (mediaEnrichmentEntity.getBackdropUrl() == null) {
                    pe9Var.bindNull(3);
                } else {
                    pe9Var.bindString(3, mediaEnrichmentEntity.getBackdropUrl());
                }
                if (mediaEnrichmentEntity.getLogoUrl() == null) {
                    pe9Var.bindNull(4);
                } else {
                    pe9Var.bindString(4, mediaEnrichmentEntity.getLogoUrl());
                }
                if (mediaEnrichmentEntity.getGenres() == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindString(5, mediaEnrichmentEntity.getGenres());
                }
                if (mediaEnrichmentEntity.getCast() == null) {
                    pe9Var.bindNull(6);
                } else {
                    pe9Var.bindString(6, mediaEnrichmentEntity.getCast());
                }
                if (mediaEnrichmentEntity.getRuntime() == null) {
                    pe9Var.bindNull(7);
                } else {
                    pe9Var.bindString(7, mediaEnrichmentEntity.getRuntime());
                }
                if (mediaEnrichmentEntity.getCertification() == null) {
                    pe9Var.bindNull(8);
                } else {
                    pe9Var.bindString(8, mediaEnrichmentEntity.getCertification());
                }
                pe9Var.bindLong(9, mediaEnrichmentEntity.getLastUpdated());
            }
        };
        this.__preparedStmtOfUpdateProgress = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.6
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "UPDATE watch_progress SET progress = ?, lastWatchedAt = ? WHERE tmdbId = ?";
            }
        };
        this.__preparedStmtOfClearCategory = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.7
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM media_content WHERE category = ?";
            }
        };
        this.__preparedStmtOfClearOldCache = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.8
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM media_content WHERE cachedAt < ?";
            }
        };
        this.__preparedStmtOfDeleteAllContent = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.9
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM media_content";
            }
        };
        this.__preparedStmtOfDeleteAllImages = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.10
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM media_images";
            }
        };
        this.__preparedStmtOfDeleteAllRatings = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.11
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM media_ratings";
            }
        };
        this.__preparedStmtOfDeleteAllEnrichments = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.12
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM media_enrichment";
            }
        };
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void __fetchRelationshipmediaImagesAscomStrmrPsDataLocalMediaImageEntity(@vo6 hj5<os5> hj5Var) {
        if (hj5Var.h() == 0) {
            return;
        }
        if (hj5Var.h() > 999) {
            wx7.a(hj5Var, new ns5(this, 2));
            return;
        }
        StringBuilder sbQ = vw2.q("SELECT `id`,`tmdbId`,`posterUrl`,`backdropUrl`,`logoUrl` FROM `media_images` WHERE `tmdbId` IN (");
        int iH = hj5Var.h();
        z79.a(sbQ, iH);
        sbQ.append(")");
        p58 p58VarD = p58.d(iH, sbQ.toString());
        int i = 1;
        for (int i2 = 0; i2 < hj5Var.h(); i2++) {
            p58VarD.bindLong(i, hj5Var.f(i2));
            i++;
        }
        Cursor cursorB = sp1.b(this.__db, p58VarD, false);
        try {
            int iA = yn1.a(cursorB, "tmdbId");
            if (iA == -1) {
                cursorB.close();
                return;
            }
            while (cursorB.moveToNext()) {
                long j = cursorB.getLong(iA);
                if (hj5Var.e(j) >= 0) {
                    hj5Var.g(j, new os5(cursorB.isNull(2) ? null : cursorB.getString(2), cursorB.getInt(1), cursorB.isNull(3) ? null : cursorB.getString(3), cursorB.isNull(4) ? null : cursorB.getString(4), cursorB.getLong(0)));
                }
            }
        } finally {
            cursorB.close();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void __fetchRelationshipmediaRatingsAscomStrmrPsDataLocalMediaRatingEntity(@vo6 hj5<bt5> hj5Var) {
        if (hj5Var.h() == 0) {
            return;
        }
        if (hj5Var.h() > 999) {
            wx7.a(hj5Var, new ns5(this, 1));
            return;
        }
        StringBuilder sbQ = vw2.q("SELECT `id`,`tmdbId`,`tmdbRating`,`imdbRating`,`traktRating`,`rottenTomatoesRating`,`updatedAt` FROM `media_ratings` WHERE `tmdbId` IN (");
        int iH = hj5Var.h();
        z79.a(sbQ, iH);
        sbQ.append(")");
        p58 p58VarD = p58.d(iH, sbQ.toString());
        int i = 1;
        for (int i2 = 0; i2 < hj5Var.h(); i2++) {
            p58VarD.bindLong(i, hj5Var.f(i2));
            i++;
        }
        Cursor cursorB = sp1.b(this.__db, p58VarD, false);
        try {
            int iA = yn1.a(cursorB, "tmdbId");
            if (iA == -1) {
                return;
            }
            while (cursorB.moveToNext()) {
                long j = cursorB.getLong(iA);
                if (hj5Var.e(j) >= 0) {
                    hj5Var.g(j, new bt5(cursorB.getLong(0), cursorB.getInt(1), cursorB.isNull(2) ? null : Float.valueOf(cursorB.getFloat(2)), cursorB.isNull(3) ? null : Float.valueOf(cursorB.getFloat(3)), cursorB.isNull(4) ? null : Float.valueOf(cursorB.getFloat(4)), cursorB.isNull(5) ? null : Integer.valueOf(cursorB.getInt(5)), cursorB.getLong(6)));
                }
            }
        } finally {
            cursorB.close();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void __fetchRelationshipwatchProgressAscomStrmrPsDataLocalWatchProgressEntity(@vo6 hj5<nna> hj5Var) {
        if (hj5Var.h() == 0) {
            return;
        }
        if (hj5Var.h() > 999) {
            wx7.a(hj5Var, new ns5(this, 0));
            return;
        }
        StringBuilder sbQ = vw2.q("SELECT `tmdbId`,`progress`,`lastWatchedAt`,`episodeId`,`seasonNumber`,`episodeNumber` FROM `watch_progress` WHERE `tmdbId` IN (");
        int iH = hj5Var.h();
        z79.a(sbQ, iH);
        sbQ.append(")");
        p58 p58VarD = p58.d(iH, sbQ.toString());
        int i = 1;
        for (int i2 = 0; i2 < hj5Var.h(); i2++) {
            p58VarD.bindLong(i, hj5Var.f(i2));
            i++;
        }
        Cursor cursorB = sp1.b(this.__db, p58VarD, false);
        try {
            int iA = yn1.a(cursorB, "tmdbId");
            if (iA == -1) {
                return;
            }
            while (cursorB.moveToNext()) {
                long j = cursorB.getLong(iA);
                if (hj5Var.e(j) >= 0) {
                    hj5Var.g(j, new nna(cursorB.getInt(0), cursorB.getFloat(1), cursorB.getLong(2), cursorB.isNull(3) ? null : Integer.valueOf(cursorB.getInt(3)), cursorB.isNull(4) ? null : Integer.valueOf(cursorB.getInt(4)), cursorB.isNull(5) ? null : Integer.valueOf(cursorB.getInt(5))));
                }
            }
        } finally {
            cursorB.close();
        }
    }

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

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ e6a lambda$__fetchRelationshipmediaImagesAscomStrmrPsDataLocalMediaImageEntity$2(hj5 hj5Var) {
        __fetchRelationshipmediaImagesAscomStrmrPsDataLocalMediaImageEntity(hj5Var);
        return e6a.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ e6a lambda$__fetchRelationshipmediaRatingsAscomStrmrPsDataLocalMediaRatingEntity$3(hj5 hj5Var) {
        __fetchRelationshipmediaRatingsAscomStrmrPsDataLocalMediaRatingEntity(hj5Var);
        return e6a.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ e6a lambda$__fetchRelationshipwatchProgressAscomStrmrPsDataLocalWatchProgressEntity$4(hj5 hj5Var) {
        __fetchRelationshipwatchProgressAscomStrmrPsDataLocalWatchProgressEntity(hj5Var);
        return e6a.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ Object lambda$appendToCategory$1(List list, List list2, List list3, Continuation continuation) {
        return MediaDao.DefaultImpls.appendToCategory(this, list, list2, list3, continuation);
    }

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

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object appendToCategory(List<js5> list, List<os5> list2, List<bt5> list3, Continuation<? super e6a> continuation) {
        return n58.a(this.__db, new ej(this, list, list2, list3, 1), continuation);
    }

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

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

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

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

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

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

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object getCachedCount(String str, long j, Continuation<? super Integer> continuation) {
        final p58 p58VarD = p58.d(2, "\n        SELECT COUNT(*) FROM media_content\n        WHERE category = ?\n        AND cachedAt > ?\n    ");
        p58VarD.bindString(1, str);
        return mk1.c(this.__db, false, vw2.e(p58VarD, 2, j), new Callable<Integer>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.31
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Integer call() throws Exception {
                Cursor cursorB = sp1.b(MediaDao_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.MediaDao
    public Object getEnrichmentByTmdbId(int i, Continuation<? super MediaEnrichmentEntity> continuation) {
        final p58 p58VarD = p58.d(1, "SELECT * FROM media_enrichment WHERE tmdbId = ?");
        return mk1.c(this.__db, false, vw2.e(p58VarD, 1, i), new Callable<MediaEnrichmentEntity>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.34
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @rq6
            public MediaEnrichmentEntity call() throws Exception {
                Cursor cursorB = sp1.b(MediaDao_Impl.this.__db, p58VarD, false);
                try {
                    int iB = yn1.b(cursorB, "tmdbId");
                    int iB2 = yn1.b(cursorB, "posterUrl");
                    int iB3 = yn1.b(cursorB, "backdropUrl");
                    int iB4 = yn1.b(cursorB, "logoUrl");
                    int iB5 = yn1.b(cursorB, "genres");
                    int iB6 = yn1.b(cursorB, "cast");
                    int iB7 = yn1.b(cursorB, "runtime");
                    int iB8 = yn1.b(cursorB, "certification");
                    int iB9 = yn1.b(cursorB, "lastUpdated");
                    MediaEnrichmentEntity mediaEnrichmentEntity = null;
                    if (cursorB.moveToFirst()) {
                        mediaEnrichmentEntity = new MediaEnrichmentEntity(cursorB.getInt(iB), cursorB.isNull(iB2) ? null : cursorB.getString(iB2), cursorB.isNull(iB3) ? null : cursorB.getString(iB3), cursorB.isNull(iB4) ? null : cursorB.getString(iB4), cursorB.isNull(iB5) ? null : cursorB.getString(iB5), cursorB.isNull(iB6) ? null : cursorB.getString(iB6), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.getLong(iB9));
                    }
                    return mediaEnrichmentEntity;
                } finally {
                    cursorB.close();
                    p58VarD.release();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object getEnrichmentsByTmdbIds(List<Integer> list, Continuation<? super List<MediaEnrichmentEntity>> continuation) {
        StringBuilder sbQ = vw2.q("SELECT * FROM media_enrichment WHERE tmdbId IN (");
        int size = list.size();
        z79.a(sbQ, size);
        sbQ.append(")");
        final p58 p58VarD = p58.d(size, sbQ.toString());
        Iterator<Integer> it = list.iterator();
        int i = 1;
        while (it.hasNext()) {
            p58VarD.bindLong(i, it.next().intValue());
            i++;
        }
        return mk1.c(this.__db, false, new CancellationSignal(), new Callable<List<MediaEnrichmentEntity>>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.33
            @Override // java.util.concurrent.Callable
            @vo6
            public List<MediaEnrichmentEntity> call() throws Exception {
                Cursor cursorB = sp1.b(MediaDao_Impl.this.__db, p58VarD, false);
                try {
                    int iB = yn1.b(cursorB, "tmdbId");
                    int iB2 = yn1.b(cursorB, "posterUrl");
                    int iB3 = yn1.b(cursorB, "backdropUrl");
                    int iB4 = yn1.b(cursorB, "logoUrl");
                    int iB5 = yn1.b(cursorB, "genres");
                    int iB6 = yn1.b(cursorB, "cast");
                    int iB7 = yn1.b(cursorB, "runtime");
                    int iB8 = yn1.b(cursorB, "certification");
                    int iB9 = yn1.b(cursorB, "lastUpdated");
                    ArrayList arrayList = new ArrayList(cursorB.getCount());
                    while (cursorB.moveToNext()) {
                        arrayList.add(new MediaEnrichmentEntity(cursorB.getInt(iB), cursorB.isNull(iB2) ? null : cursorB.getString(iB2), cursorB.isNull(iB3) ? null : cursorB.getString(iB3), cursorB.isNull(iB4) ? null : cursorB.getString(iB4), cursorB.isNull(iB5) ? null : cursorB.getString(iB5), cursorB.isNull(iB6) ? null : cursorB.getString(iB6), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.getLong(iB9)));
                    }
                    return arrayList;
                } finally {
                    cursorB.close();
                    p58VarD.release();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object getMaxPosition(String str, Continuation<? super Integer> continuation) {
        final p58 p58VarD = p58.d(1, "SELECT COALESCE(MAX(position), -1) FROM media_content WHERE category = ?");
        return mk1.c(this.__db, false, vw2.f(p58VarD, 1, str), new Callable<Integer>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.32
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Integer call() throws Exception {
                Cursor cursorB = sp1.b(MediaDao_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.MediaDao
    public j43<List<st5>> getMediaByCategory(String str) {
        final p58 p58VarD = p58.d(1, "\n        SELECT * FROM media_content\n        WHERE category = ?\n        ORDER BY position ASC\n    ");
        p58VarD.bindString(1, str);
        return mk1.a(this.__db, true, new String[]{"media_images", "media_ratings", "watch_progress", "media_content"}, new Callable<List<st5>>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.28
            public void finalize() {
                p58VarD.release();
            }

            /* JADX WARN: Multi-variable type inference failed */
            @Override // java.util.concurrent.Callable
            @vo6
            public List<st5> call() throws Exception {
                int i;
                String str2;
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    Cursor cursorB = sp1.b(MediaDao_Impl.this.__db, p58VarD, true);
                    try {
                        int iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                        int iB2 = yn1.b(cursorB, "tmdbId");
                        int iB3 = yn1.b(cursorB, "imdbId");
                        int iB4 = yn1.b(cursorB, "title");
                        int iB5 = yn1.b(cursorB, "overview");
                        int iB6 = yn1.b(cursorB, "year");
                        int iB7 = yn1.b(cursorB, "runtime");
                        int iB8 = yn1.b(cursorB, "certification");
                        int iB9 = yn1.b(cursorB, "contentType");
                        int iB10 = yn1.b(cursorB, "category");
                        int iB11 = yn1.b(cursorB, "position");
                        int iB12 = yn1.b(cursorB, "genres");
                        int iB13 = yn1.b(cursorB, "cast");
                        int iB14 = yn1.b(cursorB, "cachedAt");
                        hj5 hj5Var = new hj5();
                        int i2 = iB13;
                        hj5 hj5Var2 = new hj5();
                        int i3 = iB12;
                        hj5 hj5Var3 = new hj5();
                        while (true) {
                            i = iB11;
                            str2 = null;
                            if (!cursorB.moveToNext()) {
                                break;
                            }
                            hj5Var.g(cursorB.getLong(iB2), null);
                            hj5Var2.g(cursorB.getLong(iB2), null);
                            hj5Var3.g(cursorB.getLong(iB2), null);
                            iB9 = iB9;
                            iB11 = i;
                            iB10 = iB10;
                        }
                        int i4 = iB9;
                        int i5 = iB10;
                        cursorB.moveToPosition(-1);
                        MediaDao_Impl.this.__fetchRelationshipmediaImagesAscomStrmrPsDataLocalMediaImageEntity(hj5Var);
                        MediaDao_Impl.this.__fetchRelationshipmediaRatingsAscomStrmrPsDataLocalMediaRatingEntity(hj5Var2);
                        MediaDao_Impl.this.__fetchRelationshipwatchProgressAscomStrmrPsDataLocalWatchProgressEntity(hj5Var3);
                        ArrayList arrayList = new ArrayList(cursorB.getCount());
                        while (cursorB.moveToNext()) {
                            long j = cursorB.getLong(iB);
                            int i6 = cursorB.getInt(iB2);
                            String string = cursorB.isNull(iB3) ? str2 : cursorB.getString(iB3);
                            String string2 = cursorB.getString(iB4);
                            String string3 = cursorB.isNull(iB5) ? str2 : cursorB.getString(iB5);
                            String string4 = cursorB.isNull(iB6) ? str2 : cursorB.getString(iB6);
                            Integer numValueOf = cursorB.isNull(iB7) ? str2 : Integer.valueOf(cursorB.getInt(iB7));
                            String string5 = cursorB.isNull(iB8) ? str2 : cursorB.getString(iB8);
                            int i7 = i4;
                            String string6 = cursorB.getString(i7);
                            int i8 = i5;
                            String string7 = cursorB.getString(i8);
                            int i9 = iB;
                            int i10 = i;
                            int i11 = cursorB.getInt(i10);
                            i = i10;
                            int i12 = i3;
                            String string8 = cursorB.isNull(i12) ? null : cursorB.getString(i12);
                            i3 = i12;
                            int i13 = i2;
                            String string9 = cursorB.isNull(i13) ? null : cursorB.getString(i13);
                            i2 = i13;
                            int i14 = iB14;
                            iB14 = i14;
                            arrayList.add(new st5(new js5(j, i6, string, string2, string3, string4, numValueOf, string5, string6, string7, i11, string8, string9, cursorB.getLong(i14)), (os5) hj5Var.c(cursorB.getLong(iB2)), (bt5) hj5Var2.c(cursorB.getLong(iB2)), (nna) hj5Var3.c(cursorB.getLong(iB2))));
                            i4 = i7;
                            iB = i9;
                            iB3 = iB3;
                            iB4 = iB4;
                            iB5 = iB5;
                            iB6 = iB6;
                            i5 = i8;
                            str2 = null;
                        }
                        MediaDao_Impl.this.__db.setTransactionSuccessful();
                        cursorB.close();
                        return arrayList;
                    } catch (Throwable th) {
                        cursorB.close();
                        throw th;
                    }
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        });
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object getMediaDetails(int i, Continuation<? super rt5> continuation) {
        final p58 p58VarD = p58.d(1, "SELECT * FROM media_content WHERE tmdbId = ?");
        return mk1.c(this.__db, true, vw2.e(p58VarD, 1, i), new Callable<rt5>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.29
            @Override // java.util.concurrent.Callable
            @rq6
            public rt5 call() throws Exception {
                int i2;
                rt5 rt5Var;
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    Cursor cursorB = sp1.b(MediaDao_Impl.this.__db, p58VarD, true);
                    try {
                        int iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                        int iB2 = yn1.b(cursorB, "tmdbId");
                        int iB3 = yn1.b(cursorB, "imdbId");
                        int iB4 = yn1.b(cursorB, "title");
                        int iB5 = yn1.b(cursorB, "overview");
                        int iB6 = yn1.b(cursorB, "year");
                        int iB7 = yn1.b(cursorB, "runtime");
                        int iB8 = yn1.b(cursorB, "certification");
                        int iB9 = yn1.b(cursorB, "contentType");
                        int iB10 = yn1.b(cursorB, "category");
                        int iB11 = yn1.b(cursorB, "position");
                        int iB12 = yn1.b(cursorB, "genres");
                        int iB13 = yn1.b(cursorB, "cast");
                        int iB14 = yn1.b(cursorB, "cachedAt");
                        hj5 hj5Var = new hj5();
                        hj5 hj5Var2 = new hj5();
                        hj5 hj5Var3 = new hj5();
                        while (true) {
                            i2 = iB11;
                            rt5Var = null;
                            if (!cursorB.moveToNext()) {
                                break;
                            }
                            hj5Var.g(cursorB.getLong(iB2), null);
                            hj5Var2.g(cursorB.getLong(iB2), null);
                            hj5Var3.g(cursorB.getLong(iB2), null);
                            iB9 = iB9;
                            iB11 = i2;
                            iB10 = iB10;
                        }
                        int i3 = iB9;
                        int i4 = iB10;
                        cursorB.moveToPosition(-1);
                        MediaDao_Impl.this.__fetchRelationshipmediaImagesAscomStrmrPsDataLocalMediaImageEntity(hj5Var);
                        MediaDao_Impl.this.__fetchRelationshipmediaRatingsAscomStrmrPsDataLocalMediaRatingEntity(hj5Var2);
                        MediaDao_Impl.this.__fetchRelationshipwatchProgressAscomStrmrPsDataLocalWatchProgressEntity(hj5Var3);
                        if (cursorB.moveToFirst()) {
                            rt5Var = new rt5(new js5(cursorB.getLong(iB), cursorB.getInt(iB2), cursorB.isNull(iB3) ? null : cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : cursorB.getString(iB5), cursorB.isNull(iB6) ? null : cursorB.getString(iB6), cursorB.isNull(iB7) ? null : Integer.valueOf(cursorB.getInt(iB7)), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.getString(i3), cursorB.getString(i4), cursorB.getInt(i2), cursorB.isNull(iB12) ? null : cursorB.getString(iB12), cursorB.isNull(iB13) ? null : cursorB.getString(iB13), cursorB.getLong(iB14)), (os5) hj5Var.c(cursorB.getLong(iB2)), (bt5) hj5Var2.c(cursorB.getLong(iB2)), (nna) hj5Var3.c(cursorB.getLong(iB2)));
                        }
                        MediaDao_Impl.this.__db.setTransactionSuccessful();
                        cursorB.close();
                        p58VarD.release();
                        return rt5Var;
                    } catch (Throwable th) {
                        cursorB.close();
                        p58VarD.release();
                        throw th;
                    }
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object insertContent(final js5 js5Var, Continuation<? super Long> continuation) {
        return mk1.b(this.__db, new Callable<Long>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.13
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public Long call() throws Exception {
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    Long lValueOf = Long.valueOf(MediaDao_Impl.this.__insertionAdapterOfMediaContentEntity.insertAndReturnId(js5Var));
                    MediaDao_Impl.this.__db.setTransactionSuccessful();
                    return lValueOf;
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

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

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object insertEnrichment(final MediaEnrichmentEntity mediaEnrichmentEntity, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.20
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    MediaDao_Impl.this.__insertionAdapterOfMediaEnrichmentEntity.insert(mediaEnrichmentEntity);
                    MediaDao_Impl.this.__db.setTransactionSuccessful();
                    return e6a.a;
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object insertImages(final os5 os5Var, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.15
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    MediaDao_Impl.this.__insertionAdapterOfMediaImageEntity.insert(os5Var);
                    MediaDao_Impl.this.__db.setTransactionSuccessful();
                    return e6a.a;
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

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

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object insertProgress(final nna nnaVar, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.19
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    MediaDao_Impl.this.__insertionAdapterOfWatchProgressEntity.insert(nnaVar);
                    MediaDao_Impl.this.__db.setTransactionSuccessful();
                    return e6a.a;
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object insertRatings(final bt5 bt5Var, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.17
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    MediaDao_Impl.this.__insertionAdapterOfMediaRatingEntity.insert(bt5Var);
                    MediaDao_Impl.this.__db.setTransactionSuccessful();
                    return e6a.a;
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }

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

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public j43<rt5> observeMediaDetails(int i) {
        final p58 p58VarD = p58.d(1, "SELECT * FROM media_content WHERE tmdbId = ?");
        p58VarD.bindLong(1, i);
        return mk1.a(this.__db, true, new String[]{"media_images", "media_ratings", "watch_progress", "media_content"}, new Callable<rt5>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.30
            public void finalize() {
                p58VarD.release();
            }

            @Override // java.util.concurrent.Callable
            @rq6
            public rt5 call() throws Exception {
                int i2;
                rt5 rt5Var;
                MediaDao_Impl.this.__db.beginTransaction();
                try {
                    Cursor cursorB = sp1.b(MediaDao_Impl.this.__db, p58VarD, true);
                    try {
                        int iB = yn1.b(cursorB, TtmlNode.ATTR_ID);
                        int iB2 = yn1.b(cursorB, "tmdbId");
                        int iB3 = yn1.b(cursorB, "imdbId");
                        int iB4 = yn1.b(cursorB, "title");
                        int iB5 = yn1.b(cursorB, "overview");
                        int iB6 = yn1.b(cursorB, "year");
                        int iB7 = yn1.b(cursorB, "runtime");
                        int iB8 = yn1.b(cursorB, "certification");
                        int iB9 = yn1.b(cursorB, "contentType");
                        int iB10 = yn1.b(cursorB, "category");
                        int iB11 = yn1.b(cursorB, "position");
                        int iB12 = yn1.b(cursorB, "genres");
                        int iB13 = yn1.b(cursorB, "cast");
                        int iB14 = yn1.b(cursorB, "cachedAt");
                        hj5 hj5Var = new hj5();
                        hj5 hj5Var2 = new hj5();
                        hj5 hj5Var3 = new hj5();
                        while (true) {
                            i2 = iB11;
                            rt5Var = null;
                            if (!cursorB.moveToNext()) {
                                break;
                            }
                            hj5Var.g(cursorB.getLong(iB2), null);
                            hj5Var2.g(cursorB.getLong(iB2), null);
                            hj5Var3.g(cursorB.getLong(iB2), null);
                            iB9 = iB9;
                            iB11 = i2;
                            iB10 = iB10;
                        }
                        int i3 = iB9;
                        int i4 = iB10;
                        cursorB.moveToPosition(-1);
                        MediaDao_Impl.this.__fetchRelationshipmediaImagesAscomStrmrPsDataLocalMediaImageEntity(hj5Var);
                        MediaDao_Impl.this.__fetchRelationshipmediaRatingsAscomStrmrPsDataLocalMediaRatingEntity(hj5Var2);
                        MediaDao_Impl.this.__fetchRelationshipwatchProgressAscomStrmrPsDataLocalWatchProgressEntity(hj5Var3);
                        if (cursorB.moveToFirst()) {
                            rt5Var = new rt5(new js5(cursorB.getLong(iB), cursorB.getInt(iB2), cursorB.isNull(iB3) ? null : cursorB.getString(iB3), cursorB.getString(iB4), cursorB.isNull(iB5) ? null : cursorB.getString(iB5), cursorB.isNull(iB6) ? null : cursorB.getString(iB6), cursorB.isNull(iB7) ? null : Integer.valueOf(cursorB.getInt(iB7)), cursorB.isNull(iB8) ? null : cursorB.getString(iB8), cursorB.getString(i3), cursorB.getString(i4), cursorB.getInt(i2), cursorB.isNull(iB12) ? null : cursorB.getString(iB12), cursorB.isNull(iB13) ? null : cursorB.getString(iB13), cursorB.getLong(iB14)), (os5) hj5Var.c(cursorB.getLong(iB2)), (bt5) hj5Var2.c(cursorB.getLong(iB2)), (nna) hj5Var3.c(cursorB.getLong(iB2)));
                        }
                        MediaDao_Impl.this.__db.setTransactionSuccessful();
                        cursorB.close();
                        return rt5Var;
                    } catch (Throwable th) {
                        cursorB.close();
                        throw th;
                    }
                } finally {
                    MediaDao_Impl.this.__db.endTransaction();
                }
            }
        });
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object replaceCategory(String str, List<js5> list, List<os5> list2, List<bt5> list3, Continuation<? super e6a> continuation) {
        return n58.a(this.__db, new ms5(this, str, list, list2, list3), continuation);
    }

    @Override // com.strmr.ps.data.local.dao.MediaDao
    public Object updateProgress(final int i, final float f, final long j, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.MediaDao_Impl.21
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = MediaDao_Impl.this.__preparedStmtOfUpdateProgress.acquire();
                pe9VarAcquire.bindDouble(1, f);
                pe9VarAcquire.bindLong(2, j);
                pe9VarAcquire.bindLong(3, i);
                try {
                    MediaDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        MediaDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        MediaDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    MediaDao_Impl.this.__preparedStmtOfUpdateProgress.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }
}
