package com.strmr.ps.ui.actor;

import android.util.Log;
import androidx.media3.common.C;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import androidx.media3.session.MediaUtils;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.tmdb.TMDBGenre;
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 defpackage.ak1;
import defpackage.ck1;
import defpackage.cr4;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.od0;
import defpackage.q38;
import defpackage.s38;
import defpackage.y41;
import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
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\u0004\u0018\u00010\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Lcom/strmr/ps/data/model/ContentItem;", "<anonymous>", "(Lak1;)Lcom/strmr/ps/data/model/ContentItem;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.actor.ActorDetailsFragment$fetchDetailedHero$2", f = "ActorDetailsFragment.kt", i = {}, l = {623, 639}, m = "invokeSuspend", n = {}, s = {})
final class b extends SuspendLambda implements gr3<ak1, Continuation<? super ContentItem>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ ContentItem c;
    public final /* synthetic */ ActorDetailsFragment d;

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public b(ContentItem contentItem, ActorDetailsFragment actorDetailsFragment, Continuation continuation) {
        super(2, continuation);
        this.c = contentItem;
        this.d = actorDetailsFragment;
    }

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

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

    /* JADX WARN: Removed duplicated region for block: B:30:0x0071 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:33:0x007d A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0089 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00a0  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00ac A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00b8 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:46:0x00c4 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:58:0x013c A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:61:0x0148 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:64:0x0154 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:65:0x016b  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x0177 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:71:0x0183 A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    /* JADX WARN: Removed duplicated region for block: B:74:0x018f A[Catch: all -> 0x001d, TryCatch #0 {all -> 0x001d, blocks: (B:7:0x0016, B:28:0x0069, B:30:0x0071, B:31:0x0075, B:33:0x007d, B:34:0x0081, B:36:0x0089, B:38:0x00a2, B:40:0x00ac, B:41:0x00b0, B:43:0x00b8, B:44:0x00bc, B:46:0x00c4, B:47:0x00c8, B:14:0x002c, B:56:0x0134, B:58:0x013c, B:59:0x0140, B:61:0x0148, B:62:0x014c, B:64:0x0154, B:66:0x016d, B:68:0x0177, B:69:0x017b, B:71:0x0183, B:72:0x0187, B:74:0x018f, B:75:0x0193, B:17:0x003b, B:22:0x0052, B:24:0x0056, B:48:0x011a, B:49:0x011d, B:50:0x011e, B:52:0x0122, B:76:0x01e4, B:77:0x01e7), top: B:84:0x000c }] */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        Object objA;
        Object movieDetails;
        ContentItem contentItem;
        Object showDetails;
        ContentItem contentItem2;
        String backdropUrl$default;
        String logoUrl$default;
        Double voteAverage;
        Integer ratingPercentage;
        String year;
        String backdropUrl$default2;
        String logoUrl$default2;
        Double voteAverage2;
        Integer ratingPercentage2;
        String year2;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        ContentItem contentItem3 = this.c;
        try {
            if (i == 0) {
                s38.b(obj);
                int i2 = a.a[contentItem3.getItemType().ordinal()];
                ActorDetailsFragment actorDetailsFragment = this.d;
                if (i2 == 1) {
                    TMDBApiService tMDBApiService = actorDetailsFragment.ad;
                    if (tMDBApiService == null) {
                        cr4.n("tmdbApiService");
                        throw null;
                    }
                    int tmdbId = contentItem3.getTmdbId();
                    this.b = contentItem3;
                    this.a = 1;
                    movieDetails = tMDBApiService.getMovieDetails(tmdbId, "credits,images", this);
                    if (movieDetails != ck1Var) {
                        contentItem = contentItem3;
                        TMDBMovieDetails tMDBMovieDetails = (TMDBMovieDetails) movieDetails;
                        backdropUrl$default = TMDBMovieDetails.getBackdropUrl$default(tMDBMovieDetails, null, 1, null);
                        if (backdropUrl$default == null) {
                        }
                        String str = backdropUrl$default;
                        logoUrl$default = TMDBMovieDetails.getLogoUrl$default(tMDBMovieDetails, null, 1, null);
                        if (logoUrl$default == null) {
                        }
                        String str2 = logoUrl$default;
                        List<TMDBGenre> genres = tMDBMovieDetails.getGenres();
                        if (genres == null) {
                        }
                        String castNames$default = TMDBMovieDetails.getCastNames$default(tMDBMovieDetails, 0, 1, null);
                        voteAverage = tMDBMovieDetails.getVoteAverage();
                        if (voteAverage == null) {
                        }
                        Double d = voteAverage;
                        ratingPercentage = tMDBMovieDetails.getRatingPercentage();
                        if (ratingPercentage == null) {
                        }
                        Integer num = ratingPercentage;
                        year = tMDBMovieDetails.getYear();
                        if (year == null) {
                        }
                        objA = contentItem.copy(((-1179113) & 1) != 0 ? contentItem.id : 0, ((-1179113) & 2) != 0 ? contentItem.itemType : null, ((-1179113) & 4) != 0 ? contentItem.tmdbId : 0, ((-1179113) & 8) != 0 ? contentItem.imdbId : null, ((-1179113) & 16) != 0 ? contentItem.title : null, ((-1179113) & 32) != 0 ? contentItem.overview : null, ((-1179113) & 64) != 0 ? contentItem.posterUrl : null, ((-1179113) & 128) != 0 ? contentItem.backdropUrl : str, ((-1179113) & 256) != 0 ? contentItem.logoUrl : str2, ((-1179113) & 512) != 0 ? contentItem.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem.year : year, ((-1179113) & 2048) != 0 ? contentItem.rating : d, ((-1179113) & 4096) != 0 ? contentItem.ratingPercentage : num, ((-1179113) & 8192) != 0 ? contentItem.genres : strAi, ((-1179113) & 16384) != 0 ? contentItem.runtime : null, ((-1179113) & 32768) != 0 ? contentItem.cast : castNames$default, ((-1179113) & 65536) != 0 ? contentItem.certification : tMDBMovieDetails.getCertification(), ((-1179113) & 131072) != 0 ? contentItem.imdbRating : null, ((-1179113) & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) != 0 ? contentItem.rottenTomatoesRating : null, ((-1179113) & 524288) != 0 ? contentItem.traktRating : null, ((-1179113) & ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES) != 0 ? contentItem.watchProgress : null, ((-1179113) & 2097152) != 0 ? contentItem.continueWatchingPlaybackId : null, ((-1179113) & 4194304) != 0 ? contentItem.continueWatchingSeason : null, ((-1179113) & 8388608) != 0 ? contentItem.continueWatchingEpisode : null, ((-1179113) & Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE) != 0 ? contentItem.continueWatchingIsRewatch : false, ((-1179113) & 33554432) != 0 ? contentItem.showTitle : null, ((-1179113) & C.BUFFER_FLAG_NOT_DEPENDED_ON) != 0 ? contentItem.sourceAddonUrl : null, ((-1179113) & C.BUFFER_FLAG_FIRST_SAMPLE) != 0 ? contentItem.directStreamUrl : null, ((-1179113) & 268435456) != 0 ? contentItem.calendarDate : null, ((-1179113) & 536870912) != 0 ? contentItem.calendarDayLabel : null, ((-1179113) & 1073741824) != 0 ? contentItem.calendarShowCount : 0, ((-1179113) & Integer.MIN_VALUE) != 0 ? contentItem.calendarEpisodes : null, (2047 & 1) != 0 ? contentItem.showStatus : null, (2047 & 2) != 0 ? contentItem.episodeIndicator : null, (2047 & 4) != 0 ? contentItem.unwatchedEpisodeCount : null, (2047 & 8) != 0 ? contentItem.addedAt : null, (2047 & 16) != 0 ? contentItem.watchedAt : null, (2047 & 32) != 0 ? contentItem.watchers : null, (2047 & 64) != 0 ? contentItem.tagline : null, (2047 & 128) != 0 ? contentItem.stremioId : null, (2047 & 256) != 0 ? contentItem.stremioType : null, (2047 & 512) != 0 ? contentItem.extraData : null, (2047 & 1024) != 0 ? contentItem.focusGifUrl : null);
                    }
                } else if (i2 != 2) {
                    objA = null;
                } else {
                    TMDBApiService tMDBApiService2 = actorDetailsFragment.ad;
                    if (tMDBApiService2 == null) {
                        cr4.n("tmdbApiService");
                        throw null;
                    }
                    int tmdbId2 = contentItem3.getTmdbId();
                    this.b = contentItem3;
                    this.a = 2;
                    showDetails = tMDBApiService2.getShowDetails(tmdbId2, "credits,images,content_ratings", this);
                    if (showDetails != ck1Var) {
                        contentItem2 = contentItem3;
                        TMDBShowDetails tMDBShowDetails = (TMDBShowDetails) showDetails;
                        backdropUrl$default2 = TMDBShowDetails.getBackdropUrl$default(tMDBShowDetails, null, 1, null);
                        if (backdropUrl$default2 == null) {
                        }
                        String str3 = backdropUrl$default2;
                        logoUrl$default2 = TMDBShowDetails.getLogoUrl$default(tMDBShowDetails, null, 1, null);
                        if (logoUrl$default2 == null) {
                        }
                        String str4 = logoUrl$default2;
                        List<TMDBGenre> genres2 = tMDBShowDetails.getGenres();
                        if (genres2 == null) {
                        }
                        String castNames$default2 = TMDBShowDetails.getCastNames$default(tMDBShowDetails, 0, 1, null);
                        voteAverage2 = tMDBShowDetails.getVoteAverage();
                        if (voteAverage2 == null) {
                        }
                        Double d2 = voteAverage2;
                        ratingPercentage2 = tMDBShowDetails.getRatingPercentage();
                        if (ratingPercentage2 == null) {
                        }
                        Integer num2 = ratingPercentage2;
                        year2 = tMDBShowDetails.getYear();
                        if (year2 == null) {
                        }
                        objA = 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 : str3, ((-1179113) & 256) != 0 ? contentItem2.logoUrl : str4, ((-1179113) & 512) != 0 ? contentItem2.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem2.year : year2, ((-1179113) & 2048) != 0 ? contentItem2.rating : d2, ((-1179113) & 4096) != 0 ? contentItem2.ratingPercentage : num2, ((-1179113) & 8192) != 0 ? contentItem2.genres : strAi, ((-1179113) & 16384) != 0 ? contentItem2.runtime : null, ((-1179113) & 32768) != 0 ? contentItem2.cast : castNames$default2, ((-1179113) & 65536) != 0 ? contentItem2.certification : tMDBShowDetails.getCertification(), ((-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);
                    }
                }
                return ck1Var;
            }
            if (i == 1) {
                ContentItem contentItem4 = (ContentItem) this.b;
                s38.b(obj);
                movieDetails = obj;
                contentItem = contentItem4;
                TMDBMovieDetails tMDBMovieDetails2 = (TMDBMovieDetails) movieDetails;
                backdropUrl$default = TMDBMovieDetails.getBackdropUrl$default(tMDBMovieDetails2, null, 1, null);
                if (backdropUrl$default == null) {
                    backdropUrl$default = contentItem.getBackdropUrl();
                }
                String str5 = backdropUrl$default;
                logoUrl$default = TMDBMovieDetails.getLogoUrl$default(tMDBMovieDetails2, null, 1, null);
                if (logoUrl$default == null) {
                    logoUrl$default = contentItem.getLogoUrl();
                }
                String str22 = logoUrl$default;
                List<TMDBGenre> genres3 = tMDBMovieDetails2.getGenres();
                String strAi = genres3 == null ? y41.ai(genres3, ", ", null, null, new od0(15), 30) : null;
                String castNames$default3 = TMDBMovieDetails.getCastNames$default(tMDBMovieDetails2, 0, 1, null);
                voteAverage = tMDBMovieDetails2.getVoteAverage();
                if (voteAverage == null) {
                    voteAverage = contentItem.getRating();
                }
                Double d3 = voteAverage;
                ratingPercentage = tMDBMovieDetails2.getRatingPercentage();
                if (ratingPercentage == null) {
                    ratingPercentage = contentItem.getRatingPercentage();
                }
                Integer num3 = ratingPercentage;
                year = tMDBMovieDetails2.getYear();
                if (year == null) {
                    year = contentItem.getYear();
                }
                objA = contentItem.copy(((-1179113) & 1) != 0 ? contentItem.id : 0, ((-1179113) & 2) != 0 ? contentItem.itemType : null, ((-1179113) & 4) != 0 ? contentItem.tmdbId : 0, ((-1179113) & 8) != 0 ? contentItem.imdbId : null, ((-1179113) & 16) != 0 ? contentItem.title : null, ((-1179113) & 32) != 0 ? contentItem.overview : null, ((-1179113) & 64) != 0 ? contentItem.posterUrl : null, ((-1179113) & 128) != 0 ? contentItem.backdropUrl : str5, ((-1179113) & 256) != 0 ? contentItem.logoUrl : str22, ((-1179113) & 512) != 0 ? contentItem.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem.year : year, ((-1179113) & 2048) != 0 ? contentItem.rating : d3, ((-1179113) & 4096) != 0 ? contentItem.ratingPercentage : num3, ((-1179113) & 8192) != 0 ? contentItem.genres : strAi, ((-1179113) & 16384) != 0 ? contentItem.runtime : null, ((-1179113) & 32768) != 0 ? contentItem.cast : castNames$default3, ((-1179113) & 65536) != 0 ? contentItem.certification : tMDBMovieDetails2.getCertification(), ((-1179113) & 131072) != 0 ? contentItem.imdbRating : null, ((-1179113) & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) != 0 ? contentItem.rottenTomatoesRating : null, ((-1179113) & 524288) != 0 ? contentItem.traktRating : null, ((-1179113) & ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES) != 0 ? contentItem.watchProgress : null, ((-1179113) & 2097152) != 0 ? contentItem.continueWatchingPlaybackId : null, ((-1179113) & 4194304) != 0 ? contentItem.continueWatchingSeason : null, ((-1179113) & 8388608) != 0 ? contentItem.continueWatchingEpisode : null, ((-1179113) & Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE) != 0 ? contentItem.continueWatchingIsRewatch : false, ((-1179113) & 33554432) != 0 ? contentItem.showTitle : null, ((-1179113) & C.BUFFER_FLAG_NOT_DEPENDED_ON) != 0 ? contentItem.sourceAddonUrl : null, ((-1179113) & C.BUFFER_FLAG_FIRST_SAMPLE) != 0 ? contentItem.directStreamUrl : null, ((-1179113) & 268435456) != 0 ? contentItem.calendarDate : null, ((-1179113) & 536870912) != 0 ? contentItem.calendarDayLabel : null, ((-1179113) & 1073741824) != 0 ? contentItem.calendarShowCount : 0, ((-1179113) & Integer.MIN_VALUE) != 0 ? contentItem.calendarEpisodes : null, (2047 & 1) != 0 ? contentItem.showStatus : null, (2047 & 2) != 0 ? contentItem.episodeIndicator : null, (2047 & 4) != 0 ? contentItem.unwatchedEpisodeCount : null, (2047 & 8) != 0 ? contentItem.addedAt : null, (2047 & 16) != 0 ? contentItem.watchedAt : null, (2047 & 32) != 0 ? contentItem.watchers : null, (2047 & 64) != 0 ? contentItem.tagline : null, (2047 & 128) != 0 ? contentItem.stremioId : null, (2047 & 256) != 0 ? contentItem.stremioType : null, (2047 & 512) != 0 ? contentItem.extraData : null, (2047 & 1024) != 0 ? contentItem.focusGifUrl : null);
            } else {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ContentItem contentItem5 = (ContentItem) this.b;
                s38.b(obj);
                showDetails = obj;
                contentItem2 = contentItem5;
                TMDBShowDetails tMDBShowDetails2 = (TMDBShowDetails) showDetails;
                backdropUrl$default2 = TMDBShowDetails.getBackdropUrl$default(tMDBShowDetails2, null, 1, null);
                if (backdropUrl$default2 == null) {
                    backdropUrl$default2 = contentItem2.getBackdropUrl();
                }
                String str32 = backdropUrl$default2;
                logoUrl$default2 = TMDBShowDetails.getLogoUrl$default(tMDBShowDetails2, null, 1, null);
                if (logoUrl$default2 == null) {
                    logoUrl$default2 = contentItem2.getLogoUrl();
                }
                String str42 = logoUrl$default2;
                List<TMDBGenre> genres22 = tMDBShowDetails2.getGenres();
                String strAi2 = genres22 == null ? y41.ai(genres22, ", ", null, null, new od0(16), 30) : null;
                String castNames$default22 = TMDBShowDetails.getCastNames$default(tMDBShowDetails2, 0, 1, null);
                voteAverage2 = tMDBShowDetails2.getVoteAverage();
                if (voteAverage2 == null) {
                    voteAverage2 = contentItem2.getRating();
                }
                Double d22 = voteAverage2;
                ratingPercentage2 = tMDBShowDetails2.getRatingPercentage();
                if (ratingPercentage2 == null) {
                    ratingPercentage2 = contentItem2.getRatingPercentage();
                }
                Integer num22 = ratingPercentage2;
                year2 = tMDBShowDetails2.getYear();
                if (year2 == null) {
                    year2 = contentItem2.getYear();
                }
                objA = 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 : str32, ((-1179113) & 256) != 0 ? contentItem2.logoUrl : str42, ((-1179113) & 512) != 0 ? contentItem2.episodeStillUrl : null, ((-1179113) & 1024) != 0 ? contentItem2.year : year2, ((-1179113) & 2048) != 0 ? contentItem2.rating : d22, ((-1179113) & 4096) != 0 ? contentItem2.ratingPercentage : num22, ((-1179113) & 8192) != 0 ? contentItem2.genres : strAi2, ((-1179113) & 16384) != 0 ? contentItem2.runtime : null, ((-1179113) & 32768) != 0 ? contentItem2.cast : castNames$default22, ((-1179113) & 65536) != 0 ? contentItem2.certification : tMDBShowDetails2.getCertification(), ((-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);
            }
        } catch (Throwable th) {
            objA = s38.a(th);
        }
        Throwable thA = q38.a(objA);
        if (thA == null) {
            return objA;
        }
        Log.w("ActorDetailsFragment", "Failed to enrich hero details for " + contentItem3.getTitle(), thA);
        return null;
    }
}
