package com.strmr.ps.data.repository;

import com.strmr.ps.data.model.trakt.TraktWatchlistItem;
import com.strmr.ps.data.remote.api.TraktApiService;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.s38;
import java.util.List;
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\u0010\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lak1;", "", "Lcom/strmr/ps/data/model/trakt/TraktWatchlistItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.data.repository.TraktSyncRepository$fetchWatchlist$2$showsDeferred$1", f = "TraktSyncRepository.kt", i = {}, l = {594, 594}, m = "invokeSuspend", n = {}, s = {})
public final class TraktSyncRepository$fetchWatchlist$2$showsDeferred$1 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends TraktWatchlistItem>>, Object> {
    final /* synthetic */ String $authHeader;
    int label;
    final /* synthetic */ TraktSyncRepository this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public TraktSyncRepository$fetchWatchlist$2$showsDeferred$1(TraktSyncRepository traktSyncRepository, String str, Continuation<? super TraktSyncRepository$fetchWatchlist$2$showsDeferred$1> continuation) {
        super(2, continuation);
        this.this$0 = traktSyncRepository;
        this.$authHeader = str;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
        return new TraktSyncRepository$fetchWatchlist$2$showsDeferred$1(this.this$0, this.$authHeader, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(ak1 ak1Var, Continuation<? super List<TraktWatchlistItem>> continuation) {
        return ((TraktSyncRepository$fetchWatchlist$2$showsDeferred$1) create(ak1Var, continuation)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.label;
        if (i == 0) {
            s38.b(obj);
            TraktSyncRepository traktSyncRepository = this.this$0;
            this.label = 1;
            if (traktSyncRepository.awaitRateLimitBackoff(this) != ck1Var) {
            }
        }
        if (i != 1) {
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return obj;
        }
        s38.b(obj);
        TraktApiService traktApiService = this.this$0.traktApiService;
        String str = this.$authHeader;
        this.label = 2;
        Object watchlistShows$default = TraktApiService.DefaultImpls.getWatchlistShows$default(traktApiService, str, null, null, 0, 0, null, this, 62, null);
        return watchlistShows$default == ck1Var ? ck1Var : watchlistShows$default;
    }
}
