package com.strmr.ps.data.repository;

import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.s38;
import defpackage.sq3;
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;

/* 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.data.repository.OmdbRepository$getOrFetchRating$1$1", f = "OmdbRepository.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
public final class OmdbRepository$getOrFetchRating$1$1 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    final /* synthetic */ String $imdbId;
    final /* synthetic */ sq3<Double, e6a> $onReady;
    int label;
    final /* synthetic */ OmdbRepository this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public OmdbRepository$getOrFetchRating$1$1(OmdbRepository omdbRepository, String str, sq3<? super Double, e6a> sq3Var, Continuation<? super OmdbRepository$getOrFetchRating$1$1> continuation) {
        super(2, continuation);
        this.this$0 = omdbRepository;
        this.$imdbId = str;
        this.$onReady = sq3Var;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
        return new OmdbRepository$getOrFetchRating$1$1(this.this$0, this.$imdbId, this.$onReady, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(ak1 ak1Var, Continuation<? super e6a> continuation) {
        return ((OmdbRepository$getOrFetchRating$1$1) create(ak1Var, continuation)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        if (this.label != 0) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        s38.b(obj);
        Double dFetchRating = this.this$0.fetchRating(this.$imdbId);
        this.this$0.cache.put(this.$imdbId, Boxing.boxDouble(dFetchRating != null ? dFetchRating.doubleValue() : Double.NaN));
        this.this$0.inFlight.remove(this.$imdbId);
        this.$onReady.invoke(dFetchRating);
        return e6a.a;
    }
}
