package com.strmr.ps.ui.details;

import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.leanback.widget.HorizontalGridView;
import androidx.media3.common.C;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import androidx.media3.session.MediaUtils;
import com.google.android.material.button.MaterialButton;
import com.strmr.ps.R;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.tmdb.TMDBCredits;
import com.strmr.ps.data.model.tmdb.TMDBExternalIds;
import com.strmr.ps.data.model.tmdb.TMDBSeason;
import com.strmr.ps.data.model.tmdb.TMDBShowDetails;
import com.strmr.ps.data.model.trakt.TraktShowProgress;
import com.strmr.ps.ui.details.DetailsFragment;
import defpackage.ak1;
import defpackage.b62;
import defpackage.ck1;
import defpackage.cr4;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.i85;
import defpackage.ik2;
import defpackage.n89;
import defpackage.o62;
import defpackage.s38;
import defpackage.vw2;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.x24;
import defpackage.y41;
import defpackage.zd8;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import okhttp3.internal.http2.Http2Connection;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.details.DetailsFragment$fetchShowDetails$2$1", f = "DetailsFragment.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
@vx8
final class l extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public final /* synthetic */ DetailsFragment a;
    public final /* synthetic */ TMDBShowDetails b;
    public final /* synthetic */ List c;
    public final /* synthetic */ int d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public l(DetailsFragment detailsFragment, TMDBShowDetails tMDBShowDetails, List list, int i, Continuation continuation) {
        super(2, continuation);
        this.a = detailsFragment;
        this.b = tMDBShowDetails;
        this.c = list;
        this.d = i;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new l(this.a, this.b, this.c, this.d, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        l lVar = (l) create((ak1) obj, (Continuation) obj2);
        e6a e6aVar = e6a.a;
        lVar.invokeSuspend(e6aVar);
        return e6aVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:83:0x01b2  */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        String logoUrl$default;
        String tagline;
        int size;
        final List listBj;
        ContentItem contentItemCopy;
        ck1 ck1Var = ck1.a;
        s38.b(obj);
        final DetailsFragment detailsFragment = this.a;
        ContentItem contentItem = detailsFragment.f;
        String logoUrl = contentItem != null ? contentItem.getLogoUrl() : null;
        TMDBShowDetails tMDBShowDetails = this.b;
        if ((logoUrl == null || n89.ab(logoUrl)) && (logoUrl$default = TMDBShowDetails.getLogoUrl$default(tMDBShowDetails, null, 1, null)) != null) {
            detailsFragment.ac(logoUrl$default);
            ContentItem contentItem2 = detailsFragment.f;
            detailsFragment.f = contentItem2 != null ? contentItem2.copy(((-1179113) & 1) != 0 ? contentItem2.id : 0, ((-1179113) & 2) != 0 ? contentItem2.itemType : null, ((-1179113) & 4) != 0 ? contentItem2.tmdbId : 0, ((-1179113) & 8) != 0 ? contentItem2.imdbId : null, ((-1179113) & 16) != 0 ? contentItem2.title : null, ((-1179113) & 32) != 0 ? contentItem2.overview : null, ((-1179113) & 64) != 0 ? contentItem2.posterUrl : null, ((-1179113) & 128) != 0 ? contentItem2.backdropUrl : null, ((-1179113) & 256) != 0 ? contentItem2.logoUrl : logoUrl$default, ((-1179113) & 512) != 0 ? contentItem2.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem2.year : null, ((-1179113) & 2048) != 0 ? contentItem2.rating : null, ((-1179113) & 4096) != 0 ? contentItem2.ratingPercentage : null, ((-1179113) & 8192) != 0 ? contentItem2.genres : null, ((-1179113) & 16384) != 0 ? contentItem2.runtime : null, ((-1179113) & 32768) != 0 ? contentItem2.cast : null, ((-1179113) & 65536) != 0 ? contentItem2.certification : null, ((-1179113) & 131072) != 0 ? contentItem2.imdbRating : null, ((-1179113) & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) != 0 ? contentItem2.rottenTomatoesRating : null, ((-1179113) & 524288) != 0 ? contentItem2.traktRating : null, ((-1179113) & ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES) != 0 ? contentItem2.watchProgress : null, ((-1179113) & 2097152) != 0 ? contentItem2.continueWatchingPlaybackId : null, ((-1179113) & 4194304) != 0 ? contentItem2.continueWatchingSeason : null, ((-1179113) & 8388608) != 0 ? contentItem2.continueWatchingEpisode : null, ((-1179113) & Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE) != 0 ? contentItem2.continueWatchingIsRewatch : false, ((-1179113) & 33554432) != 0 ? contentItem2.showTitle : null, ((-1179113) & C.BUFFER_FLAG_NOT_DEPENDED_ON) != 0 ? contentItem2.sourceAddonUrl : null, ((-1179113) & C.BUFFER_FLAG_FIRST_SAMPLE) != 0 ? contentItem2.directStreamUrl : null, ((-1179113) & 268435456) != 0 ? contentItem2.calendarDate : null, ((-1179113) & 536870912) != 0 ? contentItem2.calendarDayLabel : null, ((-1179113) & 1073741824) != 0 ? contentItem2.calendarShowCount : 0, ((-1179113) & Integer.MIN_VALUE) != 0 ? contentItem2.calendarEpisodes : null, (2047 & 1) != 0 ? contentItem2.showStatus : null, (2047 & 2) != 0 ? contentItem2.episodeIndicator : null, (2047 & 4) != 0 ? contentItem2.unwatchedEpisodeCount : null, (2047 & 8) != 0 ? contentItem2.addedAt : null, (2047 & 16) != 0 ? contentItem2.watchedAt : null, (2047 & 32) != 0 ? contentItem2.watchers : null, (2047 & 64) != 0 ? contentItem2.tagline : null, (2047 & 128) != 0 ? contentItem2.stremioId : null, (2047 & 256) != 0 ? contentItem2.stremioType : null, (2047 & 512) != 0 ? contentItem2.extraData : null, (2047 & 1024) != 0 ? contentItem2.focusGifUrl : null) : null;
        }
        ContentItem contentItem3 = detailsFragment.f;
        String tagline2 = contentItem3 != null ? contentItem3.getTagline() : null;
        if ((tagline2 == null || n89.ab(tagline2)) && (tagline = tMDBShowDetails.getTagline()) != null) {
            if (n89.ab(tagline)) {
                tagline = null;
            }
            if (tagline != null) {
                TextView textView = detailsFragment.o;
                if (textView == null) {
                    cr4.n("detailsTagline");
                    throw null;
                }
                x24.g(textView, tagline);
                ContentItem contentItem4 = detailsFragment.f;
                detailsFragment.f = contentItem4 != null ? 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 : null, ((-1179113) & 16) != 0 ? contentItem4.title : null, ((-1179113) & 32) != 0 ? contentItem4.overview : null, ((-1179113) & 64) != 0 ? contentItem4.posterUrl : null, ((-1179113) & 128) != 0 ? contentItem4.backdropUrl : null, ((-1179113) & 256) != 0 ? contentItem4.logoUrl : null, ((-1179113) & 512) != 0 ? contentItem4.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem4.year : null, ((-1179113) & 2048) != 0 ? contentItem4.rating : null, ((-1179113) & 4096) != 0 ? contentItem4.ratingPercentage : null, ((-1179113) & 8192) != 0 ? contentItem4.genres : null, ((-1179113) & 16384) != 0 ? contentItem4.runtime : null, ((-1179113) & 32768) != 0 ? contentItem4.cast : null, ((-1179113) & 65536) != 0 ? contentItem4.certification : null, ((-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 : null, ((-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 : tagline, (2047 & 128) != 0 ? contentItem4.stremioId : null, (2047 & 256) != 0 ? contentItem4.stremioType : null, (2047 & 512) != 0 ? contentItem4.extraData : null, (2047 & 1024) != 0 ? contentItem4.focusGifUrl : null) : null;
            }
        }
        detailsFragment.bt = tMDBShowDetails.getTrailerKey();
        TMDBExternalIds externalIds = tMDBShowDetails.getExternalIds();
        detailsFragment.bu = externalIds != null ? externalIds.getImdbId() : null;
        Integer numberOfSeasons = tMDBShowDetails.getNumberOfSeasons();
        if (numberOfSeasons != null) {
            size = numberOfSeasons.intValue();
        } else {
            List<TMDBSeason> seasons = tMDBShowDetails.getSeasons();
            if (seasons != null) {
                ArrayList arrayList = new ArrayList();
                for (Object obj2 : seasons) {
                    Integer seasonNumber = ((TMDBSeason) obj2).getSeasonNumber();
                    if ((seasonNumber != null ? seasonNumber.intValue() : 0) > 0) {
                        arrayList.add(obj2);
                    }
                }
                size = arrayList.size();
            } else {
                size = 0;
            }
        }
        detailsFragment.bv = size;
        detailsFragment.bx = TMDBShowDetails.getPosterUrl$default(tMDBShowDetails, null, 1, null);
        String firstAirDate = tMDBShowDetails.getFirstAirDate();
        String strBb = "";
        String strBb2 = firstAirDate != null ? n89.bb(4, firstAirDate) : "";
        String status = tMDBShowDetails.getStatus();
        if (status != null && status.equalsIgnoreCase("Ended")) {
            String lastAirDate = tMDBShowDetails.getLastAirDate();
            if (lastAirDate != null) {
                strBb = n89.bb(4, lastAirDate);
            }
        } else {
            String status2 = tMDBShowDetails.getStatus();
            if (!(status2 != null && status2.equalsIgnoreCase("Canceled"))) {
                strBb = "Present";
            }
        }
        if (!n89.ab(strBb2) && !n89.ab(strBb)) {
            strBb2 = vw2.l(strBb2, " - ", strBb);
        }
        detailsFragment.bw = strBb2;
        ContentItem contentItem5 = detailsFragment.f;
        if (contentItem5 != null && (contentItemCopy = contentItem5.copy(((-1179113) & 1) != 0 ? contentItem5.id : 0, ((-1179113) & 2) != 0 ? contentItem5.itemType : null, ((-1179113) & 4) != 0 ? contentItem5.tmdbId : 0, ((-1179113) & 8) != 0 ? contentItem5.imdbId : null, ((-1179113) & 16) != 0 ? contentItem5.title : null, ((-1179113) & 32) != 0 ? contentItem5.overview : null, ((-1179113) & 64) != 0 ? contentItem5.posterUrl : null, ((-1179113) & 128) != 0 ? contentItem5.backdropUrl : null, ((-1179113) & 256) != 0 ? contentItem5.logoUrl : null, ((-1179113) & 512) != 0 ? contentItem5.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem5.year : null, ((-1179113) & 2048) != 0 ? contentItem5.rating : null, ((-1179113) & 4096) != 0 ? contentItem5.ratingPercentage : null, ((-1179113) & 8192) != 0 ? contentItem5.genres : null, ((-1179113) & 16384) != 0 ? contentItem5.runtime : null, ((-1179113) & 32768) != 0 ? contentItem5.cast : null, ((-1179113) & 65536) != 0 ? contentItem5.certification : null, ((-1179113) & 131072) != 0 ? contentItem5.imdbRating : null, ((-1179113) & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) != 0 ? contentItem5.rottenTomatoesRating : null, ((-1179113) & 524288) != 0 ? contentItem5.traktRating : null, ((-1179113) & ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES) != 0 ? contentItem5.watchProgress : null, ((-1179113) & 2097152) != 0 ? contentItem5.continueWatchingPlaybackId : null, ((-1179113) & 4194304) != 0 ? contentItem5.continueWatchingSeason : null, ((-1179113) & 8388608) != 0 ? contentItem5.continueWatchingEpisode : null, ((-1179113) & Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE) != 0 ? contentItem5.continueWatchingIsRewatch : false, ((-1179113) & 33554432) != 0 ? contentItem5.showTitle : null, ((-1179113) & C.BUFFER_FLAG_NOT_DEPENDED_ON) != 0 ? contentItem5.sourceAddonUrl : null, ((-1179113) & C.BUFFER_FLAG_FIRST_SAMPLE) != 0 ? contentItem5.directStreamUrl : null, ((-1179113) & 268435456) != 0 ? contentItem5.calendarDate : null, ((-1179113) & 536870912) != 0 ? contentItem5.calendarDayLabel : null, ((-1179113) & 1073741824) != 0 ? contentItem5.calendarShowCount : 0, ((-1179113) & Integer.MIN_VALUE) != 0 ? contentItem5.calendarEpisodes : null, (2047 & 1) != 0 ? contentItem5.showStatus : tMDBShowDetails.getStatus(), (2047 & 2) != 0 ? contentItem5.episodeIndicator : null, (2047 & 4) != 0 ? contentItem5.unwatchedEpisodeCount : null, (2047 & 8) != 0 ? contentItem5.addedAt : null, (2047 & 16) != 0 ? contentItem5.watchedAt : null, (2047 & 32) != 0 ? contentItem5.watchers : null, (2047 & 64) != 0 ? contentItem5.tagline : null, (2047 & 128) != 0 ? contentItem5.stremioId : null, (2047 & 256) != 0 ? contentItem5.stremioType : null, (2047 & 512) != 0 ? contentItem5.extraData : null, (2047 & 1024) != 0 ? contentItem5.focusGifUrl : null)) != null) {
            TextView textView2 = detailsFragment.p;
            if (textView2 == null) {
                cr4.n("detailsMetadata");
                throw null;
            }
            x24.f(textView2, contentItemCopy);
        }
        MaterialButton materialButton = detailsFragment.w;
        if (materialButton == null) {
            cr4.n("buttonWatched");
            throw null;
        }
        materialButton.setIcon(detailsFragment.getResources().getDrawable(R.drawable.ic_quality, null));
        MaterialButton materialButton2 = detailsFragment.w;
        if (materialButton2 == null) {
            cr4.n("buttonWatched");
            throw null;
        }
        materialButton2.setContentDescription("Episode Ratings");
        MaterialButton materialButton3 = detailsFragment.w;
        if (materialButton3 == null) {
            cr4.n("buttonWatched");
            throw null;
        }
        materialButton3.setOnClickListener(new b62(detailsFragment, 1));
        MaterialButton materialButton4 = detailsFragment.w;
        if (materialButton4 == null) {
            cr4.n("buttonWatched");
            throw null;
        }
        detailsFragment.aa(materialButton4, "Ratings");
        TMDBCredits credits = tMDBShowDetails.getCredits();
        DetailsFragment.p(detailsFragment, credits != null ? credits.getCast() : null);
        DetailsFragment.q(detailsFragment, this.c);
        List<TMDBSeason> seasons2 = tMDBShowDetails.getSeasons();
        if (seasons2 != null) {
            ArrayList arrayList2 = new ArrayList();
            for (Object obj3 : seasons2) {
                Integer seasonNumber2 = ((TMDBSeason) obj3).getSeasonNumber();
                if ((seasonNumber2 != null ? seasonNumber2.intValue() : 0) > 0) {
                    arrayList2.add(obj3);
                }
            }
            listBj = y41.bj(new o62(), arrayList2);
        } else {
            listBj = null;
        }
        if (listBj == null) {
            listBj = ik2.a;
        }
        boolean zIsEmpty = listBj.isEmpty();
        final int i = this.d;
        if (zIsEmpty) {
            LinearLayout linearLayout = detailsFragment.aj;
            if (linearLayout == null) {
                cr4.n("tvShowSection");
                throw null;
            }
            linearLayout.setVisibility(8);
        } else {
            detailsFragment.cb = listBj;
            detailsFragment.bq.clear();
            LinearLayout linearLayout2 = detailsFragment.aj;
            if (linearLayout2 == null) {
                cr4.n("tvShowSection");
                throw null;
            }
            linearLayout2.setVisibility(0);
            HorizontalGridView horizontalGridView = detailsFragment.ak;
            if (horizontalGridView == null) {
                cr4.n("seasonRow");
                throw null;
            }
            horizontalGridView.setVisibility(0);
            MaterialButton materialButton5 = detailsFragment.u;
            if (materialButton5 == null) {
                cr4.n("buttonShuffle");
                throw null;
            }
            materialButton5.setVisibility(0);
            if (detailsFragment.ax == null) {
                zd8 zd8Var = new zd8(listBj, new gr3() { // from class: com.strmr.ps.ui.details.a
                    @Override // defpackage.gr3
                    public final Object invoke(Object obj4, Object obj5) {
                        TMDBSeason tMDBSeason = (TMDBSeason) obj4;
                        int iIntValue = ((Integer) obj5).intValue();
                        int i2 = DetailsFragment.cn;
                        cr4.g(tMDBSeason, "season");
                        Integer seasonNumber3 = tMDBSeason.getSeasonNumber();
                        if (seasonNumber3 != null) {
                            int iIntValue2 = seasonNumber3.intValue();
                            DetailsFragment detailsFragment2 = detailsFragment;
                            i85 viewLifecycleOwner = detailsFragment2.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
                            wj0.c(androidx.lifecycle.s.a(viewLifecycleOwner), null, null, new t(detailsFragment2, i, 1, iIntValue2, true, null), 3);
                            zd8 zd8Var2 = detailsFragment2.ax;
                            if (zd8Var2 != null) {
                                zd8Var2.e(iIntValue);
                            }
                        }
                        return e6a.a;
                    }
                }, new gr3() { // from class: z52
                    /* JADX WARN: Removed duplicated region for block: B:38:0x0091  */
                    @Override // defpackage.gr3
                    /*
                        Code decompiled incorrectly, please refer to instructions dump.
                    */
                    public final Object invoke(Object obj4, Object obj5) {
                        Object next;
                        boolean z;
                        uo2 uo2Var;
                        LinkedHashSet linkedHashSet;
                        TMDBSeason tMDBSeason = (TMDBSeason) obj4;
                        ((Integer) obj5).getClass();
                        int i2 = DetailsFragment.cn;
                        cr4.g(tMDBSeason, "season");
                        Integer seasonNumber3 = tMDBSeason.getSeasonNumber();
                        if (seasonNumber3 != null) {
                            int iIntValue = seasonNumber3.intValue();
                            DetailsFragment detailsFragment2 = detailsFragment;
                            TraktShowProgress traktShowProgress = detailsFragment2.bp;
                            boolean zIsSeasonWatched = traktShowProgress != null ? traktShowProgress.isSeasonWatched(iIntValue) : false;
                            Iterator it = listBj.iterator();
                            while (true) {
                                if (!it.hasNext()) {
                                    next = null;
                                    break;
                                }
                                next = it.next();
                                Integer seasonNumber4 = ((TMDBSeason) next).getSeasonNumber();
                                if (seasonNumber4 != null && seasonNumber4.intValue() == iIntValue) {
                                    break;
                                }
                            }
                            boolean z2 = true;
                            if (((TMDBSeason) next) == null || ((linkedHashSet = detailsFragment2.bq) != null && linkedHashSet.isEmpty())) {
                                z = false;
                                if (!zIsSeasonWatched && !z) {
                                    z2 = false;
                                }
                                uo2Var = detailsFragment2.bo;
                                if (uo2Var != null) {
                                    ContentItem contentItem6 = detailsFragment2.f;
                                    if (contentItem6 != null) {
                                        contentItem6.getTitle();
                                    }
                                    wj0.c(uo2Var.b, null, null, new ro2(uo2Var, z2, tMDBSeason, i, null), 3);
                                }
                            } else {
                                Iterator it2 = linkedHashSet.iterator();
                                while (it2.hasNext()) {
                                    if (n89.ar((String) it2.next(), "S" + iIntValue + "E", false)) {
                                        z = true;
                                        break;
                                    }
                                }
                                z = false;
                                if (!zIsSeasonWatched) {
                                    z2 = false;
                                }
                                uo2Var = detailsFragment2.bo;
                                if (uo2Var != null) {
                                }
                            }
                        }
                        return e6a.a;
                    }
                });
                detailsFragment.ax = zd8Var;
                HorizontalGridView horizontalGridView2 = detailsFragment.ak;
                if (horizontalGridView2 == null) {
                    cr4.n("seasonRow");
                    throw null;
                }
                horizontalGridView2.setAdapter(zd8Var);
                HorizontalGridView horizontalGridView3 = detailsFragment.ak;
                if (horizontalGridView3 == null) {
                    cr4.n("seasonRow");
                    throw null;
                }
                horizontalGridView3.setNumRows(1);
                HorizontalGridView horizontalGridView4 = detailsFragment.ak;
                if (horizontalGridView4 == null) {
                    cr4.n("seasonRow");
                    throw null;
                }
                horizontalGridView4.setItemSpacing(0);
                HorizontalGridView horizontalGridView5 = detailsFragment.ak;
                if (horizontalGridView5 == null) {
                    cr4.n("seasonRow");
                    throw null;
                }
                horizontalGridView5.setHasFixedSize(true);
                HorizontalGridView horizontalGridView6 = detailsFragment.ak;
                if (horizontalGridView6 == null) {
                    cr4.n("seasonRow");
                    throw null;
                }
                horizontalGridView6.setItemViewCacheSize(8);
                HorizontalGridView horizontalGridView7 = detailsFragment.ak;
                if (horizontalGridView7 == null) {
                    cr4.n("seasonRow");
                    throw null;
                }
                horizontalGridView7.setFocusScrollStrategy(1);
            }
            i85 viewLifecycleOwner = detailsFragment.getViewLifecycleOwner();
            cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
            wj0.c(androidx.lifecycle.s.a(viewLifecycleOwner), null, null, new ab(i, detailsFragment, listBj, null), 3);
        }
        TMDBExternalIds externalIds2 = tMDBShowDetails.getExternalIds();
        DetailsFragment.n(detailsFragment, Boxing.boxInt(i), false, externalIds2 != null ? externalIds2.getImdbId() : null, tMDBShowDetails.getName());
        return e6a.a;
    }
}
