package defpackage;

import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.tmdb.TMDBImages;
import com.strmr.ps.data.remote.api.TMDBApiService;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* 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;", "Lcom/strmr/ps/data/model/tmdb/TMDBImages;", "<anonymous>", "(Lak1;)Lcom/strmr/ps/data/model/tmdb/TMDBImages;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.contextmenu.ContextMenuHelper$onChangeImageTypeSelected$1$images$1", f = "ContextMenuHelper.kt", i = {}, l = {224, 226}, m = "invokeSuspend", n = {}, s = {})
final class gg1 extends SuspendLambda implements gr3<ak1, Continuation<? super TMDBImages>, Object> {
    public int a;
    public final /* synthetic */ ContentItem b;
    public final /* synthetic */ TMDBApiService c;

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

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

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

    /* JADX WARN: Code restructure failed: missing block: B:13:0x0033, code lost:
    
        if (r6 == r0) goto L19;
     */
    /* JADX WARN: Code restructure failed: missing block: B:18:0x0043, code lost:
    
        if (r6 == r0) goto L19;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i != 0) {
            if (i == 1) {
                s38.b(obj);
                return (TMDBImages) obj;
            }
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return (TMDBImages) obj;
        }
        s38.b(obj);
        ContentItem contentItem = this.b;
        boolean zIsMovie = contentItem.isMovie();
        TMDBApiService tMDBApiService = this.c;
        if (zIsMovie) {
            int tmdbId = contentItem.getTmdbId();
            this.a = 1;
            obj = tMDBApiService.getMovieImages(tmdbId, this);
        } else {
            int tmdbId2 = contentItem.getTmdbId();
            this.a = 2;
            obj = tMDBApiService.getShowImages(tmdbId2, this);
        }
        return ck1Var;
    }
}
