package com.strmr.ps.ui.rowitems;

import android.util.Log;
import androidx.lifecycle.ak;
import androidx.media3.common.C;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import androidx.media3.exoplayer.upstream.CmcdData;
import androidx.media3.session.MediaUtils;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.tmdb.TMDBCast;
import com.strmr.ps.data.model.tmdb.TMDBCredits;
import com.strmr.ps.data.model.tmdb.TMDBExternalIds;
import com.strmr.ps.data.model.tmdb.TMDBGenre;
import com.strmr.ps.data.model.tmdb.TMDBImagesKt;
import com.strmr.ps.data.model.tmdb.TMDBMovieDetails;
import com.strmr.ps.data.model.tmdb.TMDBShowDetails;
import com.strmr.ps.data.remote.api.TMDBApiService;
import com.strmr.ps.data.repository.PreferencesRepository;
import com.strmr.ps.data.repository.WatchStatusRepository;
import dagger.hilt.android.lifecycle.HiltViewModel;
import defpackage.bka;
import defpackage.ck1;
import defpackage.cr4;
import defpackage.d21;
import defpackage.ik2;
import defpackage.kp6;
import defpackage.l24;
import defpackage.m02;
import defpackage.m12;
import defpackage.n89;
import defpackage.q78;
import defpackage.r78;
import defpackage.re6;
import defpackage.s38;
import defpackage.sc2;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.xja;
import defpackage.y41;
import defpackage.zw8;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CancellationException;
import javax.inject.Inject;
import kotlin.Metadata;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import okhttp3.internal.http2.Http2Connection;

/* JADX INFO: loaded from: classes3.dex */
@HiltViewModel
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001:\u0001\fB)\b\u0007\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004\u0012\u0006\u0010\u0007\u001a\u00020\u0006\u0012\u0006\u0010\t\u001a\u00020\b¢\u0006\u0004\b\n\u0010\u000b¨\u0006\r"}, d2 = {"Lcom/strmr/ps/ui/rowitems/RowItemsViewModel;", "Lxja;", "Lcom/strmr/ps/data/remote/api/TMDBApiService;", "tmdbApiService", "Lcom/strmr/ps/data/repository/WatchStatusRepository;", "watchStatusRepository", "Lcom/strmr/ps/data/repository/PreferencesRepository;", "preferencesRepository", "Landroidx/lifecycle/ak;", "savedStateHandle", "<init>", "(Lcom/strmr/ps/data/remote/api/TMDBApiService;Lcom/strmr/ps/data/repository/WatchStatusRepository;Lcom/strmr/ps/data/repository/PreferencesRepository;Landroidx/lifecycle/ak;)V", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public final class RowItemsViewModel extends xja {
    public final TMDBApiService a;
    public final WatchStatusRepository b;
    public final PreferencesRepository c;
    public final String d;
    public final re6 e;
    public final re6 f;
    public final re6 g;
    public final re6 h;
    public final String i;
    public String j;
    public String k;

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001R\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004R\u0014\u0010\u0006\u001a\u00020\u00058\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0006\u0010\u0007¨\u0006\b"}, d2 = {"Lcom/strmr/ps/ui/rowitems/RowItemsViewModel$a;", "", "", "TAG", "Ljava/lang/String;", "", "MAX_CONCURRENT", "I", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class a {
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public /* synthetic */ class b {
        public static final /* synthetic */ int[] a;

        static {
            int[] iArr = new int[ContentItem.ItemType.values().length];
            try {
                iArr[ContentItem.ItemType.TV_SHOW.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[ContentItem.ItemType.MOVIE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            a = iArr;
        }
    }

    @Inject
    public RowItemsViewModel(@kp6 TMDBApiService tMDBApiService, @kp6 WatchStatusRepository watchStatusRepository, @kp6 PreferencesRepository preferencesRepository, @kp6 ak akVar) {
        cr4.g(tMDBApiService, "tmdbApiService");
        cr4.g(watchStatusRepository, "watchStatusRepository");
        cr4.g(preferencesRepository, "preferencesRepository");
        cr4.g(akVar, "savedStateHandle");
        this.a = tMDBApiService;
        this.b = watchStatusRepository;
        this.c = preferencesRepository;
        String str = (String) akVar.b("title");
        str = str == null ? "Content" : str;
        this.d = str;
        re6 re6Var = new re6(ik2.a);
        this.e = re6Var;
        this.f = re6Var;
        re6 re6Var2 = new re6(Boolean.FALSE);
        this.g = re6Var2;
        this.h = re6Var2;
        String strConcat = "row_items:".concat(str);
        this.i = strConcat;
        this.j = preferencesRepository.getSubPageSortBy(strConcat);
        this.k = preferencesRepository.getSubPageSortHow(strConcat);
        ArrayList arrayList = (ArrayList) akVar.b("items");
        if (arrayList == null || arrayList.isEmpty()) {
            return;
        }
        re6Var.l(arrayList);
        re6Var2.l(Boolean.TRUE);
        d21 d21VarA = bka.a(this);
        m12 m12Var = sc2.a;
        wj0.c(d21VarA, m02.c, null, new g(arrayList, this, null), 2);
    }

    /* JADX WARN: Code restructure failed: missing block: B:30:0x007c, code lost:
    
        if (r2 == r5) goto L97;
     */
    /* JADX WARN: Code restructure failed: missing block: B:96:0x01cf, code lost:
    
        if (r2 == r5) goto L97;
     */
    /* JADX WARN: Removed duplicated region for block: B:7:0x001b  */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$PrimitiveArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object b(RowItemsViewModel rowItemsViewModel, ContentItem contentItem, ContinuationImpl continuationImpl) {
        h hVar;
        String imdbId;
        String str;
        String genres;
        String runtime;
        String cast;
        List<TMDBCast> cast2;
        Integer num;
        String str2;
        String genres2;
        String runtime2;
        String cast3;
        List<TMDBCast> cast4;
        RowItemsViewModel rowItemsViewModel2 = rowItemsViewModel;
        ContentItem contentItem2 = contentItem;
        TMDBApiService tMDBApiService = rowItemsViewModel2.a;
        if (continuationImpl instanceof h) {
            hVar = (h) continuationImpl;
            int i = hVar.e;
            if ((i & Integer.MIN_VALUE) != 0) {
                hVar.e = i - Integer.MIN_VALUE;
            } else {
                hVar = new h(rowItemsViewModel2, continuationImpl);
            }
        }
        Object showDetails = hVar.c;
        ck1 ck1Var = ck1.a;
        int i2 = hVar.e;
        try {
            try {
                try {
                    if (i2 == 0) {
                        s38.b(showDetails);
                        if (contentItem2.getTmdbId() > 0) {
                            int i3 = b.a[contentItem2.getItemType().ordinal()];
                            if (i3 == 1) {
                                int tmdbId = contentItem2.getTmdbId();
                                hVar.a = rowItemsViewModel2;
                                hVar.b = contentItem2;
                                hVar.e = 1;
                                showDetails = tMDBApiService.getShowDetails(tmdbId, "images,external_ids,credits,content_ratings", hVar);
                            } else if (i3 == 2) {
                                int tmdbId2 = contentItem2.getTmdbId();
                                hVar.a = rowItemsViewModel2;
                                hVar.b = contentItem2;
                                hVar.e = 2;
                                showDetails = tMDBApiService.getMovieDetails(tmdbId2, "images,credits,external_ids,release_dates", hVar);
                            }
                            return ck1Var;
                        }
                        return null;
                    }
                    if (i2 != 1) {
                        if (i2 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        contentItem2 = hVar.b;
                        rowItemsViewModel2 = hVar.a;
                        s38.b(showDetails);
                        ContentItem contentItem3 = contentItem2;
                        TMDBMovieDetails tMDBMovieDetails = (TMDBMovieDetails) showDetails;
                        String imdbId2 = tMDBMovieDetails.getImdbId();
                        if (imdbId2 == null) {
                            imdbId2 = contentItem3.getImdbId();
                        }
                        String str3 = imdbId2;
                        String overview = tMDBMovieDetails.getOverview();
                        if (overview == null) {
                            overview = contentItem3.getOverview();
                        }
                        String str4 = overview;
                        String posterUrl = contentItem3.getPosterUrl();
                        if (posterUrl == null) {
                            posterUrl = TMDBMovieDetails.getPosterUrl$default(tMDBMovieDetails, null, 1, null);
                        }
                        String str5 = posterUrl;
                        String backdropUrl = contentItem3.getBackdropUrl();
                        if (backdropUrl != null) {
                            str2 = backdropUrl;
                        } else {
                            String preferredBackdropPath$default = TMDBImagesKt.getPreferredBackdropPath$default(tMDBMovieDetails.getImages(), null, 1, null);
                            if (preferredBackdropPath$default == null) {
                                preferredBackdropPath$default = tMDBMovieDetails.getBackdropPath();
                            }
                            if (preferredBackdropPath$default != null) {
                                backdropUrl = "https://image.tmdb.org/t/p/w1280".concat(preferredBackdropPath$default);
                                str2 = backdropUrl;
                            } else {
                                str2 = null;
                            }
                        }
                        String logoUrl = contentItem3.getLogoUrl();
                        if (logoUrl == null) {
                            logoUrl = TMDBMovieDetails.getLogoUrl$default(tMDBMovieDetails, null, 1, null);
                        }
                        String str6 = logoUrl;
                        String releaseDate = tMDBMovieDetails.getReleaseDate();
                        String strBb = releaseDate != null ? n89.bb(4, releaseDate) : contentItem3.getYear();
                        Double voteAverage = tMDBMovieDetails.getVoteAverage();
                        if (voteAverage == null) {
                            voteAverage = contentItem3.getRating();
                        }
                        Double d = voteAverage;
                        Integer ratingPercentage = tMDBMovieDetails.getRatingPercentage();
                        if (ratingPercentage == null) {
                            ratingPercentage = contentItem3.getRatingPercentage();
                        }
                        Integer num2 = ratingPercentage;
                        List<TMDBGenre> genres3 = tMDBMovieDetails.getGenres();
                        if (genres3 == null || (genres2 = y41.ai(genres3, ",", null, null, new q78(0), 30)) == null) {
                            genres2 = contentItem3.getGenres();
                        }
                        String str7 = genres2;
                        Integer runtime3 = tMDBMovieDetails.getRuntime();
                        if (runtime3 == null || (runtime2 = runtime3.toString()) == null) {
                            runtime2 = contentItem3.getRuntime();
                        }
                        String str8 = runtime2;
                        TMDBCredits credits = tMDBMovieDetails.getCredits();
                        if (credits == null || (cast4 = credits.getCast()) == null || (cast3 = y41.ai(cast4, ", ", null, null, new q78(1), 30)) == null) {
                            cast3 = contentItem3.getCast();
                        }
                        String str9 = cast3;
                        String certification = tMDBMovieDetails.getCertification();
                        if (certification == null) {
                            certification = contentItem3.getCertification();
                        }
                        return contentItem3.copy(((-1179113) & 1) != 0 ? contentItem3.id : 0, ((-1179113) & 2) != 0 ? contentItem3.itemType : null, ((-1179113) & 4) != 0 ? contentItem3.tmdbId : 0, ((-1179113) & 8) != 0 ? contentItem3.imdbId : str3, ((-1179113) & 16) != 0 ? contentItem3.title : null, ((-1179113) & 32) != 0 ? contentItem3.overview : str4, ((-1179113) & 64) != 0 ? contentItem3.posterUrl : str5, ((-1179113) & 128) != 0 ? contentItem3.backdropUrl : str2, ((-1179113) & 256) != 0 ? contentItem3.logoUrl : str6, ((-1179113) & 512) != 0 ? contentItem3.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem3.year : strBb, ((-1179113) & 2048) != 0 ? contentItem3.rating : d, ((-1179113) & 4096) != 0 ? contentItem3.ratingPercentage : num2, ((-1179113) & 8192) != 0 ? contentItem3.genres : str7, ((-1179113) & 16384) != 0 ? contentItem3.runtime : str8, ((-1179113) & 32768) != 0 ? contentItem3.cast : str9, ((-1179113) & 65536) != 0 ? contentItem3.certification : certification, ((-1179113) & 131072) != 0 ? contentItem3.imdbRating : null, ((-1179113) & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) != 0 ? contentItem3.rottenTomatoesRating : null, ((-1179113) & 524288) != 0 ? contentItem3.traktRating : null, ((-1179113) & ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES) != 0 ? contentItem3.watchProgress : rowItemsViewModel2.b.getProgress(contentItem3.getTmdbId(), ContentItem.ItemType.MOVIE), ((-1179113) & 2097152) != 0 ? contentItem3.continueWatchingPlaybackId : null, ((-1179113) & 4194304) != 0 ? contentItem3.continueWatchingSeason : null, ((-1179113) & 8388608) != 0 ? contentItem3.continueWatchingEpisode : null, ((-1179113) & Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE) != 0 ? contentItem3.continueWatchingIsRewatch : false, ((-1179113) & 33554432) != 0 ? contentItem3.showTitle : null, ((-1179113) & C.BUFFER_FLAG_NOT_DEPENDED_ON) != 0 ? contentItem3.sourceAddonUrl : null, ((-1179113) & C.BUFFER_FLAG_FIRST_SAMPLE) != 0 ? contentItem3.directStreamUrl : null, ((-1179113) & 268435456) != 0 ? contentItem3.calendarDate : null, ((-1179113) & 536870912) != 0 ? contentItem3.calendarDayLabel : null, ((-1179113) & 1073741824) != 0 ? contentItem3.calendarShowCount : 0, ((-1179113) & Integer.MIN_VALUE) != 0 ? contentItem3.calendarEpisodes : null, (2047 & 1) != 0 ? contentItem3.showStatus : null, (2047 & 2) != 0 ? contentItem3.episodeIndicator : null, (2047 & 4) != 0 ? contentItem3.unwatchedEpisodeCount : null, (2047 & 8) != 0 ? contentItem3.addedAt : null, (2047 & 16) != 0 ? contentItem3.watchedAt : null, (2047 & 32) != 0 ? contentItem3.watchers : null, (2047 & 64) != 0 ? contentItem3.tagline : null, (2047 & 128) != 0 ? contentItem3.stremioId : null, (2047 & 256) != 0 ? contentItem3.stremioType : null, (2047 & 512) != 0 ? contentItem3.extraData : null, (2047 & 1024) != 0 ? contentItem3.focusGifUrl : null);
                    }
                    contentItem2 = hVar.b;
                    rowItemsViewModel2 = hVar.a;
                    s38.b(showDetails);
                    ContentItem contentItem4 = contentItem2;
                    TMDBShowDetails tMDBShowDetails = (TMDBShowDetails) showDetails;
                    TMDBExternalIds externalIds = tMDBShowDetails.getExternalIds();
                    if (externalIds == null || (imdbId = externalIds.getImdbId()) == null) {
                        imdbId = contentItem4.getImdbId();
                    }
                    String str10 = imdbId;
                    String overview2 = tMDBShowDetails.getOverview();
                    if (overview2 == null) {
                        overview2 = contentItem4.getOverview();
                    }
                    String str11 = overview2;
                    String posterUrl2 = contentItem4.getPosterUrl();
                    if (posterUrl2 == null) {
                        posterUrl2 = TMDBShowDetails.getPosterUrl$default(tMDBShowDetails, null, 1, null);
                    }
                    String str12 = posterUrl2;
                    String backdropUrl2 = contentItem4.getBackdropUrl();
                    if (backdropUrl2 != null) {
                        str = backdropUrl2;
                    } else {
                        String preferredBackdropPath$default2 = TMDBImagesKt.getPreferredBackdropPath$default(tMDBShowDetails.getImages(), null, 1, null);
                        if (preferredBackdropPath$default2 == null) {
                            preferredBackdropPath$default2 = tMDBShowDetails.getBackdropPath();
                        }
                        if (preferredBackdropPath$default2 != null) {
                            backdropUrl2 = "https://image.tmdb.org/t/p/w1280".concat(preferredBackdropPath$default2);
                            str = backdropUrl2;
                        } else {
                            str = null;
                        }
                    }
                    String logoUrl2 = contentItem4.getLogoUrl();
                    if (logoUrl2 == null) {
                        logoUrl2 = TMDBShowDetails.getLogoUrl$default(tMDBShowDetails, null, 1, null);
                    }
                    String str13 = logoUrl2;
                    String firstAirDate = tMDBShowDetails.getFirstAirDate();
                    String strBb2 = firstAirDate != null ? n89.bb(4, firstAirDate) : contentItem4.getYear();
                    Double voteAverage2 = tMDBShowDetails.getVoteAverage();
                    if (voteAverage2 == null) {
                        voteAverage2 = contentItem4.getRating();
                    }
                    Double d2 = voteAverage2;
                    Integer ratingPercentage2 = tMDBShowDetails.getRatingPercentage();
                    if (ratingPercentage2 == null) {
                        ratingPercentage2 = contentItem4.getRatingPercentage();
                    }
                    Integer num3 = ratingPercentage2;
                    List<TMDBGenre> genres4 = tMDBShowDetails.getGenres();
                    if (genres4 == null || (genres = y41.ai(genres4, ",", null, null, new l24(28), 30)) == null) {
                        genres = contentItem4.getGenres();
                    }
                    String str14 = genres;
                    List<Integer> episodeRunTime = tMDBShowDetails.getEpisodeRunTime();
                    if (episodeRunTime == null || (num = (Integer) y41.ab(episodeRunTime)) == null || (runtime = num.toString()) == null) {
                        runtime = contentItem4.getRuntime();
                    }
                    String str15 = runtime;
                    TMDBCredits credits2 = tMDBShowDetails.getCredits();
                    if (credits2 == null || (cast2 = credits2.getCast()) == null || (cast = y41.ai(cast2, ", ", null, null, new l24(29), 30)) == null) {
                        cast = contentItem4.getCast();
                    }
                    String str16 = cast;
                    String certification2 = tMDBShowDetails.getCertification();
                    if (certification2 == null) {
                        certification2 = contentItem4.getCertification();
                    }
                    return contentItem4.copy(((-1179113) & 1) != 0 ? contentItem4.id : 0, ((-1179113) & 2) != 0 ? contentItem4.itemType : null, ((-1179113) & 4) != 0 ? contentItem4.tmdbId : 0, ((-1179113) & 8) != 0 ? contentItem4.imdbId : str10, ((-1179113) & 16) != 0 ? contentItem4.title : null, ((-1179113) & 32) != 0 ? contentItem4.overview : str11, ((-1179113) & 64) != 0 ? contentItem4.posterUrl : str12, ((-1179113) & 128) != 0 ? contentItem4.backdropUrl : str, ((-1179113) & 256) != 0 ? contentItem4.logoUrl : str13, ((-1179113) & 512) != 0 ? contentItem4.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem4.year : strBb2, ((-1179113) & 2048) != 0 ? contentItem4.rating : d2, ((-1179113) & 4096) != 0 ? contentItem4.ratingPercentage : num3, ((-1179113) & 8192) != 0 ? contentItem4.genres : str14, ((-1179113) & 16384) != 0 ? contentItem4.runtime : str15, ((-1179113) & 32768) != 0 ? contentItem4.cast : str16, ((-1179113) & 65536) != 0 ? contentItem4.certification : certification2, ((-1179113) & 131072) != 0 ? contentItem4.imdbRating : null, ((-1179113) & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) != 0 ? contentItem4.rottenTomatoesRating : null, ((-1179113) & 524288) != 0 ? contentItem4.traktRating : null, ((-1179113) & ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES) != 0 ? contentItem4.watchProgress : rowItemsViewModel2.b.getProgress(contentItem4.getTmdbId(), ContentItem.ItemType.TV_SHOW), ((-1179113) & 2097152) != 0 ? contentItem4.continueWatchingPlaybackId : null, ((-1179113) & 4194304) != 0 ? contentItem4.continueWatchingSeason : null, ((-1179113) & 8388608) != 0 ? contentItem4.continueWatchingEpisode : null, ((-1179113) & Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE) != 0 ? contentItem4.continueWatchingIsRewatch : false, ((-1179113) & 33554432) != 0 ? contentItem4.showTitle : null, ((-1179113) & C.BUFFER_FLAG_NOT_DEPENDED_ON) != 0 ? contentItem4.sourceAddonUrl : null, ((-1179113) & C.BUFFER_FLAG_FIRST_SAMPLE) != 0 ? contentItem4.directStreamUrl : null, ((-1179113) & 268435456) != 0 ? contentItem4.calendarDate : null, ((-1179113) & 536870912) != 0 ? contentItem4.calendarDayLabel : null, ((-1179113) & 1073741824) != 0 ? contentItem4.calendarShowCount : 0, ((-1179113) & Integer.MIN_VALUE) != 0 ? contentItem4.calendarEpisodes : null, (2047 & 1) != 0 ? contentItem4.showStatus : null, (2047 & 2) != 0 ? contentItem4.episodeIndicator : null, (2047 & 4) != 0 ? contentItem4.unwatchedEpisodeCount : null, (2047 & 8) != 0 ? contentItem4.addedAt : null, (2047 & 16) != 0 ? contentItem4.watchedAt : null, (2047 & 32) != 0 ? contentItem4.watchers : null, (2047 & 64) != 0 ? contentItem4.tagline : null, (2047 & 128) != 0 ? contentItem4.stremioId : null, (2047 & 256) != 0 ? contentItem4.stremioType : null, (2047 & 512) != 0 ? contentItem4.extraData : null, (2047 & 1024) != 0 ? contentItem4.focusGifUrl : null);
                } catch (Exception e) {
                    e = e;
                    Log.w("RowItemsViewModel", "Failed to enrich " + contentItem2.getTitle() + ": " + e.getMessage());
                    return null;
                }
            } catch (Exception e2) {
                e = e2;
                Log.w("RowItemsViewModel", "Failed to enrich " + contentItem2.getTitle() + ": " + e.getMessage());
                return null;
            }
        } catch (CancellationException e3) {
            throw e3;
        }
    }

    public final void c(String str, String str2) {
        this.j = str;
        this.k = str2;
        this.c.setSubPageSort(this.i, str, str2);
        re6 re6Var = this.e;
        List list = (List) re6Var.e();
        if (list == null) {
            return;
        }
        if (str == null) {
            re6Var.l(y41.bj(new r78(), list));
        } else {
            List list2 = zw8.a;
            if (str2 == null) {
                str2 = "asc";
            }
            re6Var.l(zw8.a(str, str2, list));
        }
    }
}
