package com.strmr.ps.data.repository;

import android.content.Context;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.upstream.CmcdData;
import androidx.media3.extractor.ts.TsExtractor;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.tmdb.TMDBCast;
import com.strmr.ps.data.model.tmdb.TMDBCollection;
import com.strmr.ps.data.model.tmdb.TMDBMovie;
import com.strmr.ps.data.model.tmdb.TMDBMovieListResponse;
import com.strmr.ps.data.model.tmdb.TMDBShow;
import com.strmr.ps.data.model.tmdb.TMDBShowListResponse;
import com.strmr.ps.data.model.trakt.TraktIds;
import com.strmr.ps.data.model.trakt.TraktListItem;
import com.strmr.ps.data.model.trakt.TraktMovie;
import com.strmr.ps.data.model.trakt.TraktShow;
import com.strmr.ps.data.model.trakt.TraktTrendingMovie;
import com.strmr.ps.data.model.trakt.TraktTrendingShow;
import com.strmr.ps.data.remote.api.TMDBApiService;
import com.strmr.ps.data.remote.api.TraktApiService;
import dagger.hilt.android.qualifiers.ApplicationContext;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.cp4;
import defpackage.cr4;
import defpackage.dp4;
import defpackage.e6a;
import defpackage.fi7;
import defpackage.gr3;
import defpackage.hf5;
import defpackage.i50;
import defpackage.ik2;
import defpackage.kf4;
import defpackage.kg4;
import defpackage.kp6;
import defpackage.m02;
import defpackage.m12;
import defpackage.n41;
import defpackage.og8;
import defpackage.pq6;
import defpackage.q38;
import defpackage.q78;
import defpackage.r22;
import defpackage.rt3;
import defpackage.s38;
import defpackage.s49;
import defpackage.sc2;
import defpackage.sd2;
import defpackage.sg8;
import defpackage.sq3;
import defpackage.to4;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.y41;
import defpackage.zr7;
import defpackage.zw8;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import javax.inject.Inject;
import javax.inject.Singleton;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import okhttp3.internal.http.StatusLine;

/* JADX INFO: loaded from: classes3.dex */
@Singleton
@Metadata(d1 = {"\u0000\u0088\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\b\n\u0002\b\u000b\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0010\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0011\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0015\b\u0007\u0018\u0000 p2\u00020\u0001:\u0003pqrB3\b\u0007\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004\u0012\u0006\u0010\u0007\u001a\u00020\u0006\u0012\u0006\u0010\t\u001a\u00020\b\u0012\b\b\u0001\u0010\u000b\u001a\u00020\n¢\u0006\u0004\b\f\u0010\rJ$\u0010\u0015\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b\u0013\u0010\u0014J$\u0010\u0017\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b\u0016\u0010\u0014J$\u0010\u0019\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b\u0018\u0010\u0014J$\u0010\u001b\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b\u001a\u0010\u0014J$\u0010\u001d\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b\u001c\u0010\u0014J4\u0010#\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b!\u0010\"J4\u0010%\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b$\u0010\"J4\u0010'\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b&\u0010\"J4\u0010)\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b(\u0010\"J(\u0010-\u001a\u00020,2\u0006\u0010+\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0096@¢\u0006\u0004\b-\u0010.J.\u0010/\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u0010+\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0096@¢\u0006\u0004\b/\u0010.J4\u00101\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000eH\u0096@¢\u0006\u0004\b0\u0010\"JP\u00107\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u00102\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000e2\b\u00103\u001a\u0004\u0018\u00010*2\b\u00104\u001a\u0004\u0018\u00010*H\u0096@¢\u0006\u0004\b5\u00106JP\u00109\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u00102\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000e2\b\u00103\u001a\u0004\u0018\u00010*2\b\u00104\u001a\u0004\u0018\u00010*H\u0096@¢\u0006\u0004\b8\u00106J\u0010\u0010:\u001a\u00020,H\u0096@¢\u0006\u0004\b:\u0010;J\u001e\u0010@\u001a\b\u0012\u0004\u0012\u00020=0\u00102\u0006\u0010<\u001a\u00020\u001eH\u0086@¢\u0006\u0004\b>\u0010?J\u001e\u0010D\u001a\b\u0012\u0004\u0012\u00020B0\u00102\u0006\u0010A\u001a\u00020\u001eH\u0086@¢\u0006\u0004\bC\u0010?J`\u0010K\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110\u00102\u0006\u0010+\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010\u000f\u001a\u00020\u000e2\"\u0010H\u001a\u001e\b\u0001\u0012\u0010\u0012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00120\u00110F\u0012\u0006\u0012\u0004\u0018\u00010G0EH\u0082@¢\u0006\u0004\bI\u0010JJ&\u0010L\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0082@¢\u0006\u0004\bL\u0010MJ&\u0010N\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0082@¢\u0006\u0004\bN\u0010MJ&\u0010O\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0082@¢\u0006\u0004\bO\u0010MJ6\u0010Q\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u00102\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010P\u001a\u00020*H\u0082@¢\u0006\u0004\bQ\u0010RJ6\u0010S\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u00102\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\u0006\u0010P\u001a\u00020*H\u0082@¢\u0006\u0004\bS\u0010RJ6\u0010V\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u0010T\u001a\u00020*2\u0006\u0010U\u001a\u00020*2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0082@¢\u0006\u0004\bV\u0010WJ&\u0010X\u001a\b\u0012\u0004\u0012\u00020\u00120\u00112\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001eH\u0082@¢\u0006\u0004\bX\u0010MJ\u001d\u0010\\\u001a\u0004\u0018\u00010\u0012*\u00020Y2\u0006\u0010[\u001a\u00020ZH\u0002¢\u0006\u0004\b\\\u0010]J\u001d\u0010\\\u001a\u0004\u0018\u00010\u0012*\u00020^2\u0006\u0010[\u001a\u00020ZH\u0002¢\u0006\u0004\b\\\u0010_J\u001b\u0010a\u001a\u0004\u0018\u00010*2\b\u0010`\u001a\u0004\u0018\u00010\u001eH\u0002¢\u0006\u0004\ba\u0010bJ/\u0010f\u001a\u0004\u0018\u00010*2\b\u0010c\u001a\u0004\u0018\u00010*2\b\u0010d\u001a\u0004\u0018\u00010*2\b\u0010e\u001a\u0004\u0018\u00010*H\u0002¢\u0006\u0004\bf\u0010gR\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0003\u0010hR\u0014\u0010\u0005\u001a\u00020\u00048\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0005\u0010iR\u0014\u0010\u0007\u001a\u00020\u00068\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0007\u0010jR\u0014\u0010\t\u001a\u00020\b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\t\u0010kR\u0014\u0010\u000b\u001a\u00020\n8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u000b\u0010lR\u0014\u0010o\u001a\u00020*8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\bm\u0010n¨\u0006s"}, d2 = {"Lcom/strmr/ps/data/repository/ContentRepository;", "Lkf4;", "Lcom/strmr/ps/data/remote/api/TraktApiService;", "traktApiService", "Lcom/strmr/ps/data/remote/api/TMDBApiService;", "tmdbApiService", "Lcom/strmr/ps/data/repository/CacheRepository;", "cacheRepository", "Lkg4;", "watchStatusRepository", "Landroid/content/Context;", "context", "<init>", "(Lcom/strmr/ps/data/remote/api/TraktApiService;Lcom/strmr/ps/data/remote/api/TMDBApiService;Lcom/strmr/ps/data/repository/CacheRepository;Lkg4;Landroid/content/Context;)V", "", "forceRefresh", "Lq38;", "", "Lcom/strmr/ps/data/model/ContentItem;", "getTrendingMovies-gIAlu-s", "(ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getTrendingMovies", "getPopularMovies-gIAlu-s", "getPopularMovies", "getTrendingShows-gIAlu-s", "getTrendingShows", "getPopularShows-gIAlu-s", "getPopularShows", "getLatest4KMovies-gIAlu-s", "getLatest4KMovies", "", "page", "pageSize", "getTrendingMoviesPage-BWLJW6A", "(IIZLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getTrendingMoviesPage", "getPopularMoviesPage-BWLJW6A", "getPopularMoviesPage", "getTrendingShowsPage-BWLJW6A", "getTrendingShowsPage", "getPopularShowsPage-BWLJW6A", "getPopularShowsPage", "", "category", "Le6a;", "prefetchCategoryPage", "(Ljava/lang/String;IILkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getPlaceholderPage", "getLatest4KMoviesPage-BWLJW6A", "getLatest4KMoviesPage", "genreSlug", "sortBy", "sortHow", "getMoviesByGenrePage-bMdYcbs", "(Ljava/lang/String;IIZLjava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getMoviesByGenrePage", "getShowsByGenrePage-bMdYcbs", "getShowsByGenrePage", "cleanupCache", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "movieId", "Lcom/strmr/ps/data/repository/ContentRepository$MovieDetailsBundle;", "getMovieDetailsBundle-gIAlu-s", "(ILkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getMovieDetailsBundle", "showId", "Lcom/strmr/ps/data/repository/ContentRepository$ShowDetailsBundle;", "getShowDetailsBundle-gIAlu-s", "getShowDetailsBundle", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "", "fetcher", "getPagedContent-hUnOzRk", "(Ljava/lang/String;IIZLsq3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getPagedContent", "fetchTrendingMoviesFromApis", "(IILkotlin/coroutines/Continuation;)Ljava/lang/Object;", "fetchPopularMoviesFromApis", "fetchTrendingShowsFromApis", "sortToken", "fetchMoviesByGenreFromApis", "(Ljava/lang/String;IILjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "fetchShowsByGenreFromApis", "user", "list", "fetchUserListMoviesFromApis", "(Ljava/lang/String;Ljava/lang/String;IILkotlin/coroutines/Continuation;)Ljava/lang/Object;", "fetchPopularShowsFromApis", "Lcom/strmr/ps/data/model/trakt/TraktMovie;", "Lcom/strmr/ps/data/model/ContentItem$ItemType;", "itemType", "toPlaceholderContentItem", "(Lcom/strmr/ps/data/model/trakt/TraktMovie;Lcom/strmr/ps/data/model/ContentItem$ItemType;)Lcom/strmr/ps/data/model/ContentItem;", "Lcom/strmr/ps/data/model/trakt/TraktShow;", "(Lcom/strmr/ps/data/model/trakt/TraktShow;Lcom/strmr/ps/data/model/ContentItem$ItemType;)Lcom/strmr/ps/data/model/ContentItem;", "minutes", "formatRuntime", "(Ljava/lang/Integer;)Ljava/lang/String;", "primary", "external", "trakt", "resolveImdbId", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "Lcom/strmr/ps/data/remote/api/TraktApiService;", "Lcom/strmr/ps/data/remote/api/TMDBApiService;", "Lcom/strmr/ps/data/repository/CacheRepository;", "Lkg4;", "Landroid/content/Context;", "getImgLang", "()Ljava/lang/String;", "imgLang", "Companion", "MovieDetailsBundle", "ShowDetailsBundle", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class ContentRepository implements kf4 {

    @kp6
    public static final String CATEGORY_CONTINUE_WATCHING = "CONTINUE_WATCHING";

    @kp6
    public static final String CATEGORY_GENRE_MOVIES_PREFIX = "GENRE_MOVIES_";

    @kp6
    public static final String CATEGORY_GENRE_SHOWS_PREFIX = "GENRE_SHOWS_";

    @kp6
    public static final String CATEGORY_LATEST_4K_MOVIES = "LATEST_4K_MOVIES";

    @kp6
    public static final String CATEGORY_POPULAR_MOVIES = "POPULAR_MOVIES";

    @kp6
    public static final String CATEGORY_POPULAR_SHOWS = "POPULAR_SHOWS";

    @kp6
    public static final String CATEGORY_TRENDING_MOVIES = "TRENDING_MOVIES";

    @kp6
    public static final String CATEGORY_TRENDING_SHOWS = "TRENDING_SHOWS";
    private static final int DEFAULT_PAGE_SIZE = 20;

    @kp6
    private static final String TAG = "ContentRepository";
    private static final int TMDB_DISCOVER_PAGE_SIZE = 20;

    @kp6
    private final CacheRepository cacheRepository;

    @kp6
    private final Context context;

    @kp6
    private final TMDBApiService tmdbApiService;

    @kp6
    private final TraktApiService traktApiService;

    @kp6
    private final kg4 watchStatusRepository;

    @Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001B1\u0012\u000e\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003\u0012\u000e\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0003\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\b¢\u0006\u0004\b\t\u0010\nJ\u0011\u0010\u0010\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003HÆ\u0003J\u0011\u0010\u0011\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0003HÆ\u0003J\u000b\u0010\u0012\u001a\u0004\u0018\u00010\bHÆ\u0003J9\u0010\u0013\u001a\u00020\u00002\u0010\b\u0002\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u00032\u0010\b\u0002\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u00032\n\b\u0002\u0010\u0007\u001a\u0004\u0018\u00010\bHÆ\u0001J\u0013\u0010\u0014\u001a\u00020\u00152\b\u0010\u0016\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u0017\u001a\u00020\u0018HÖ\u0001J\t\u0010\u0019\u001a\u00020\u001aHÖ\u0001R\u0019\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\fR\u0019\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\fR\u0013\u0010\u0007\u001a\u0004\u0018\u00010\b¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u000f¨\u0006\u001b"}, d2 = {"Lcom/strmr/ps/data/repository/ContentRepository$MovieDetailsBundle;", "", "cast", "", "Lcom/strmr/ps/data/model/tmdb/TMDBCast;", "similar", "Lcom/strmr/ps/data/model/ContentItem;", "collection", "Lcom/strmr/ps/data/model/tmdb/TMDBCollection;", "<init>", "(Ljava/util/List;Ljava/util/List;Lcom/strmr/ps/data/model/tmdb/TMDBCollection;)V", "getCast", "()Ljava/util/List;", "getSimilar", "getCollection", "()Lcom/strmr/ps/data/model/tmdb/TMDBCollection;", "component1", "component2", "component3", "copy", "equals", "", "other", "hashCode", "", "toString", "", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final /* data */ class MovieDetailsBundle {

        @pq6
        private final List<TMDBCast> cast;

        @pq6
        private final TMDBCollection collection;

        @pq6
        private final List<ContentItem> similar;

        public MovieDetailsBundle(@pq6 List<TMDBCast> list, @pq6 List<ContentItem> list2, @pq6 TMDBCollection tMDBCollection) {
            this.cast = list;
            this.similar = list2;
            this.collection = tMDBCollection;
        }

        /* JADX WARN: Multi-variable type inference failed */
        public static /* synthetic */ MovieDetailsBundle copy$default(MovieDetailsBundle movieDetailsBundle, List list, List list2, TMDBCollection tMDBCollection, int i, Object obj) {
            if ((i & 1) != 0) {
                list = movieDetailsBundle.cast;
            }
            if ((i & 2) != 0) {
                list2 = movieDetailsBundle.similar;
            }
            if ((i & 4) != 0) {
                tMDBCollection = movieDetailsBundle.collection;
            }
            return movieDetailsBundle.copy(list, list2, tMDBCollection);
        }

        @pq6
        public final List<TMDBCast> component1() {
            return this.cast;
        }

        @pq6
        public final List<ContentItem> component2() {
            return this.similar;
        }

        @pq6
        /* JADX INFO: renamed from: component3, reason: from getter */
        public final TMDBCollection getCollection() {
            return this.collection;
        }

        @kp6
        public final MovieDetailsBundle copy(@pq6 List<TMDBCast> cast, @pq6 List<ContentItem> similar, @pq6 TMDBCollection collection) {
            return new MovieDetailsBundle(cast, similar, collection);
        }

        public boolean equals(@pq6 Object other) {
            if (this == other) {
                return true;
            }
            if (!(other instanceof MovieDetailsBundle)) {
                return false;
            }
            MovieDetailsBundle movieDetailsBundle = (MovieDetailsBundle) other;
            return cr4.b(this.cast, movieDetailsBundle.cast) && cr4.b(this.similar, movieDetailsBundle.similar) && cr4.b(this.collection, movieDetailsBundle.collection);
        }

        @pq6
        public final List<TMDBCast> getCast() {
            return this.cast;
        }

        @pq6
        public final TMDBCollection getCollection() {
            return this.collection;
        }

        @pq6
        public final List<ContentItem> getSimilar() {
            return this.similar;
        }

        public int hashCode() {
            List<TMDBCast> list = this.cast;
            int iHashCode = (list == null ? 0 : list.hashCode()) * 31;
            List<ContentItem> list2 = this.similar;
            int iHashCode2 = (iHashCode + (list2 == null ? 0 : list2.hashCode())) * 31;
            TMDBCollection tMDBCollection = this.collection;
            return iHashCode2 + (tMDBCollection != null ? tMDBCollection.hashCode() : 0);
        }

        @kp6
        public String toString() {
            return "MovieDetailsBundle(cast=" + this.cast + ", similar=" + this.similar + ", collection=" + this.collection + ")";
        }
    }

    @Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001B/\u0012\u000e\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003\u0012\u000e\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0003\u0012\u0006\u0010\u0007\u001a\u00020\b¢\u0006\u0004\b\t\u0010\nJ\u0011\u0010\u0010\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003HÆ\u0003J\u0011\u0010\u0011\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0003HÆ\u0003J\t\u0010\u0012\u001a\u00020\bHÆ\u0003J7\u0010\u0013\u001a\u00020\u00002\u0010\b\u0002\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u00032\u0010\b\u0002\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u00032\b\b\u0002\u0010\u0007\u001a\u00020\bHÆ\u0001J\u0013\u0010\u0014\u001a\u00020\u00152\b\u0010\u0016\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u0017\u001a\u00020\u0018HÖ\u0001J\t\u0010\u0019\u001a\u00020\u001aHÖ\u0001R\u0019\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\fR\u0019\u0010\u0005\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\fR\u0011\u0010\u0007\u001a\u00020\b¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u000f¨\u0006\u001b"}, d2 = {"Lcom/strmr/ps/data/repository/ContentRepository$ShowDetailsBundle;", "", "cast", "", "Lcom/strmr/ps/data/model/tmdb/TMDBCast;", "similar", "Lcom/strmr/ps/data/model/ContentItem;", "details", "Lcom/strmr/ps/data/model/tmdb/TMDBShow;", "<init>", "(Ljava/util/List;Ljava/util/List;Lcom/strmr/ps/data/model/tmdb/TMDBShow;)V", "getCast", "()Ljava/util/List;", "getSimilar", "getDetails", "()Lcom/strmr/ps/data/model/tmdb/TMDBShow;", "component1", "component2", "component3", "copy", "equals", "", "other", "hashCode", "", "toString", "", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final /* data */ class ShowDetailsBundle {

        @pq6
        private final List<TMDBCast> cast;

        @kp6
        private final TMDBShow details;

        @pq6
        private final List<ContentItem> similar;

        public ShowDetailsBundle(@pq6 List<TMDBCast> list, @pq6 List<ContentItem> list2, @kp6 TMDBShow tMDBShow) {
            cr4.g(tMDBShow, "details");
            this.cast = list;
            this.similar = list2;
            this.details = tMDBShow;
        }

        /* JADX WARN: Multi-variable type inference failed */
        public static /* synthetic */ ShowDetailsBundle copy$default(ShowDetailsBundle showDetailsBundle, List list, List list2, TMDBShow tMDBShow, int i, Object obj) {
            if ((i & 1) != 0) {
                list = showDetailsBundle.cast;
            }
            if ((i & 2) != 0) {
                list2 = showDetailsBundle.similar;
            }
            if ((i & 4) != 0) {
                tMDBShow = showDetailsBundle.details;
            }
            return showDetailsBundle.copy(list, list2, tMDBShow);
        }

        @pq6
        public final List<TMDBCast> component1() {
            return this.cast;
        }

        @pq6
        public final List<ContentItem> component2() {
            return this.similar;
        }

        @kp6
        /* JADX INFO: renamed from: component3, reason: from getter */
        public final TMDBShow getDetails() {
            return this.details;
        }

        @kp6
        public final ShowDetailsBundle copy(@pq6 List<TMDBCast> cast, @pq6 List<ContentItem> similar, @kp6 TMDBShow details) {
            cr4.g(details, "details");
            return new ShowDetailsBundle(cast, similar, details);
        }

        public boolean equals(@pq6 Object other) {
            if (this == other) {
                return true;
            }
            if (!(other instanceof ShowDetailsBundle)) {
                return false;
            }
            ShowDetailsBundle showDetailsBundle = (ShowDetailsBundle) other;
            return cr4.b(this.cast, showDetailsBundle.cast) && cr4.b(this.similar, showDetailsBundle.similar) && cr4.b(this.details, showDetailsBundle.details);
        }

        @pq6
        public final List<TMDBCast> getCast() {
            return this.cast;
        }

        @kp6
        public final TMDBShow getDetails() {
            return this.details;
        }

        @pq6
        public final List<ContentItem> getSimilar() {
            return this.similar;
        }

        public int hashCode() {
            List<TMDBCast> list = this.cast;
            int iHashCode = (list == null ? 0 : list.hashCode()) * 31;
            List<ContentItem> list2 = this.similar;
            return this.details.hashCode() + ((iHashCode + (list2 != null ? list2.hashCode() : 0)) * 31);
        }

        @kp6
        public String toString() {
            return "ShowDetailsBundle(cast=" + this.cast + ", similar=" + this.similar + ", details=" + this.details + ")";
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchMoviesByGenreFromApis$2, reason: invalid class name */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchMoviesByGenreFromApis$2", f = "ContentRepository.kt", i = {0}, l = {493, 541}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class AnonymousClass2 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ String $genreSlug;
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        final /* synthetic */ String $sortToken;
        private /* synthetic */ Object L$0;
        int label;
        final /* synthetic */ ContentRepository this$0;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public AnonymousClass2(String str, int i, int i2, ContentRepository contentRepository, String str2, Continuation<? super AnonymousClass2> continuation) {
            super(2, continuation);
            this.$genreSlug = str;
            this.$pageSize = i;
            this.$page = i2;
            this.this$0 = contentRepository;
            this.$sortToken = str2;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final og8 invokeSuspend$lambda$1(TMDBMovieListResponse tMDBMovieListResponse) {
            List<TMDBMovie> results = tMDBMovieListResponse.getResults();
            if (results == null) {
                results = ik2.a;
            }
            return y41.m(results);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            AnonymousClass2 anonymousClass2 = new AnonymousClass2(this.$genreSlug, this.$pageSize, this.$page, this.this$0, this.$sortToken, continuation);
            anonymousClass2.L$0 = obj;
            return anonymousClass2;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:39:0x0118, code lost:
        
            if (r15 == r0) goto L40;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            Object next;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            int i2 = 3;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                List list = s49.a;
                String str = this.$genreSlug;
                cr4.g(str, "slug");
                Iterator it = s49.a.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        next = null;
                        break;
                    }
                    next = it.next();
                    if (((rt3) next).a.equals(str)) {
                        break;
                    }
                }
                rt3 rt3Var = (rt3) next;
                Integer numValueOf = rt3Var != null ? Integer.valueOf(rt3Var.d) : null;
                if (numValueOf == null) {
                    n41.ab("Unknown genre slug: ", this.$genreSlug, ContentRepository.TAG);
                    return ik2.a;
                }
                int i3 = (this.$pageSize + 19) / 20;
                if (i3 < 1) {
                    i3 = 1;
                }
                int i4 = ((this.$page - 1) * i3) + 1;
                dp4 dp4VarG = zr7.g(0, i3);
                ContentRepository contentRepository = this.this$0;
                String str2 = this.$sortToken;
                ArrayList arrayList = new ArrayList(y41.p(dp4VarG, 10));
                Iterator<Integer> it2 = dp4VarG.iterator();
                while (((cp4) it2).c) {
                    arrayList.add(wj0.a(ak1Var, null, new ContentRepository$fetchMoviesByGenreFromApis$2$discoverPages$1$1(contentRepository, numValueOf, i4, ((to4) it2).nextInt(), str2, null), 3));
                }
                this.L$0 = ak1Var;
                this.label = 1;
                obj = i50.a(arrayList, this);
                if (obj != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return y41.bk(y41.x((Iterable) obj), this.$pageSize);
            }
            ak1Var = (ak1) this.L$0;
            s38.b(obj);
            List listS = sg8.s(new sd2(sg8.i(sg8.g(y41.m((List) obj), new q78(4)), new a(i2)), new a(4)));
            ContentRepository contentRepository2 = this.this$0;
            ArrayList arrayList2 = new ArrayList();
            Iterator it3 = listS.iterator();
            while (it3.hasNext()) {
                arrayList2.add(wj0.a(ak1Var, null, new ContentRepository$fetchMoviesByGenreFromApis$2$1$1(contentRepository2, ((TMDBMovie) it3.next()).getId(), null), 3));
            }
            this.L$0 = null;
            this.label = 2;
            obj = i50.a(arrayList2, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchPopularMoviesFromApis$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchPopularMoviesFromApis$2", f = "ContentRepository.kt", i = {0}, l = {315, 360}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class C02942 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C02942(int i, int i2, Continuation<? super C02942> continuation) {
            super(2, continuation);
            this.$pageSize = i;
            this.$page = i2;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            C02942 c02942 = ContentRepository.this.new C02942(this.$pageSize, this.$page, continuation);
            c02942.L$0 = obj;
            return c02942;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:22:0x0088, code lost:
        
            if (r13 == r0) goto L23;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            C02942 c02942;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                TraktApiService traktApiService = ContentRepository.this.traktApiService;
                int i2 = this.$pageSize;
                int i3 = this.$page;
                this.L$0 = ak1Var;
                this.label = 1;
                c02942 = this;
                obj = TraktApiService.DefaultImpls.getPopularMovies$default(traktApiService, i2, i3, null, null, c02942, 12, null);
                if (obj != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return y41.x((Iterable) obj);
            }
            ak1Var = (ak1) this.L$0;
            s38.b(obj);
            c02942 = this;
            ContentRepository contentRepository = ContentRepository.this;
            ArrayList arrayList = new ArrayList();
            Iterator it = ((List) obj).iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                TraktMovie traktMovie = (TraktMovie) it.next();
                Integer tmdb = traktMovie.getIds().getTmdb();
                r22 r22VarA = tmdb != null ? wj0.a(ak1Var, null, new ContentRepository$fetchPopularMoviesFromApis$2$1$1(contentRepository, tmdb.intValue(), traktMovie, null), 3) : null;
                if (r22VarA != null) {
                    arrayList.add(r22VarA);
                }
            }
            c02942.L$0 = null;
            c02942.label = 2;
            obj = i50.a(arrayList, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchPopularShowsFromApis$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchPopularShowsFromApis$2", f = "ContentRepository.kt", i = {0}, l = {711, 756}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class C02952 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C02952(int i, int i2, Continuation<? super C02952> continuation) {
            super(2, continuation);
            this.$pageSize = i;
            this.$page = i2;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            C02952 c02952 = ContentRepository.this.new C02952(this.$pageSize, this.$page, continuation);
            c02952.L$0 = obj;
            return c02952;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:22:0x0086, code lost:
        
            if (r12 == r0) goto L23;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            C02952 c02952;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                TraktApiService traktApiService = ContentRepository.this.traktApiService;
                int i2 = this.$pageSize;
                int i3 = this.$page;
                this.L$0 = ak1Var;
                this.label = 1;
                c02952 = this;
                obj = TraktApiService.DefaultImpls.getPopularShows$default(traktApiService, i2, i3, null, c02952, 4, null);
                if (obj != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return y41.x((Iterable) obj);
            }
            ak1Var = (ak1) this.L$0;
            s38.b(obj);
            c02952 = this;
            ContentRepository contentRepository = ContentRepository.this;
            ArrayList arrayList = new ArrayList();
            Iterator it = ((List) obj).iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                TraktShow traktShow = (TraktShow) it.next();
                Integer tmdb = traktShow.getIds().getTmdb();
                r22 r22VarA = tmdb != null ? wj0.a(ak1Var, null, new ContentRepository$fetchPopularShowsFromApis$2$1$1(contentRepository, tmdb.intValue(), traktShow, null), 3) : null;
                if (r22VarA != null) {
                    arrayList.add(r22VarA);
                }
            }
            c02952.L$0 = null;
            c02952.label = 2;
            obj = i50.a(arrayList, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchShowsByGenreFromApis$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchShowsByGenreFromApis$2", f = "ContentRepository.kt", i = {0}, l = {601, 649}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class C02962 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ String $genreSlug;
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        final /* synthetic */ String $sortToken;
        private /* synthetic */ Object L$0;
        int label;
        final /* synthetic */ ContentRepository this$0;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C02962(String str, int i, int i2, ContentRepository contentRepository, String str2, Continuation<? super C02962> continuation) {
            super(2, continuation);
            this.$genreSlug = str;
            this.$pageSize = i;
            this.$page = i2;
            this.this$0 = contentRepository;
            this.$sortToken = str2;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final og8 invokeSuspend$lambda$1(TMDBShowListResponse tMDBShowListResponse) {
            List<TMDBShow> results = tMDBShowListResponse.getResults();
            if (results == null) {
                results = ik2.a;
            }
            return y41.m(results);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            C02962 c02962 = new C02962(this.$genreSlug, this.$pageSize, this.$page, this.this$0, this.$sortToken, continuation);
            c02962.L$0 = obj;
            return c02962;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:39:0x012e, code lost:
        
            if (r2 == r1) goto L40;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            Object next;
            Object objA;
            Object objA2;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                List list = s49.a;
                String str = this.$genreSlug;
                cr4.g(str, "slug");
                Iterator it = s49.b.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        next = null;
                        break;
                    }
                    next = it.next();
                    if (((rt3) next).a.equals(str)) {
                        break;
                    }
                }
                rt3 rt3Var = (rt3) next;
                Integer numValueOf = rt3Var != null ? Integer.valueOf(rt3Var.d) : null;
                if (numValueOf == null) {
                    n41.ab("Unknown TV genre slug: ", this.$genreSlug, ContentRepository.TAG);
                    return ik2.a;
                }
                int i2 = (this.$pageSize + 19) / 20;
                if (i2 < 1) {
                    i2 = 1;
                }
                int i3 = ((this.$page - 1) * i2) + 1;
                dp4 dp4VarG = zr7.g(0, i2);
                ContentRepository contentRepository = this.this$0;
                String str2 = this.$sortToken;
                ArrayList arrayList = new ArrayList(y41.p(dp4VarG, 10));
                Iterator<Integer> it2 = dp4VarG.iterator();
                while (((cp4) it2).c) {
                    ArrayList arrayList2 = arrayList;
                    arrayList2.add(wj0.a(ak1Var, null, new ContentRepository$fetchShowsByGenreFromApis$2$discoverPages$1$1(contentRepository, numValueOf, i3, ((to4) it2).nextInt(), str2, null), 3));
                    arrayList = arrayList2;
                }
                this.L$0 = ak1Var;
                this.label = 1;
                objA = i50.a(arrayList, this);
                if (objA != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                objA2 = obj;
                return y41.bk(y41.x((Iterable) objA2), this.$pageSize);
            }
            ak1Var = (ak1) this.L$0;
            s38.b(obj);
            objA = obj;
            List listS = sg8.s(new sd2(sg8.i(sg8.g(y41.m((List) objA), new q78(4)), new a(8)), new a(9)));
            ContentRepository contentRepository2 = this.this$0;
            ArrayList arrayList3 = new ArrayList(y41.p(listS, 10));
            Iterator it3 = listS.iterator();
            while (it3.hasNext()) {
                arrayList3.add(wj0.a(ak1Var, null, new ContentRepository$fetchShowsByGenreFromApis$2$1$1(contentRepository2, ((TMDBShow) it3.next()).getId(), null), 3));
            }
            this.L$0 = null;
            this.label = 2;
            objA2 = i50.a(arrayList3, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchTrendingMoviesFromApis$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchTrendingMoviesFromApis$2", f = "ContentRepository.kt", i = {0}, l = {263, StatusLine.HTTP_PERM_REDIRECT}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class C02972 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C02972(int i, int i2, Continuation<? super C02972> continuation) {
            super(2, continuation);
            this.$pageSize = i;
            this.$page = i2;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            C02972 c02972 = ContentRepository.this.new C02972(this.$pageSize, this.$page, continuation);
            c02972.L$0 = obj;
            return c02972;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:22:0x008c, code lost:
        
            if (r13 == r0) goto L23;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            C02972 c02972;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                TraktApiService traktApiService = ContentRepository.this.traktApiService;
                int i2 = this.$pageSize;
                int i3 = this.$page;
                this.L$0 = ak1Var;
                this.label = 1;
                c02972 = this;
                obj = TraktApiService.DefaultImpls.getTrendingMovies$default(traktApiService, i2, i3, null, null, c02972, 12, null);
                if (obj != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return y41.x((Iterable) obj);
            }
            ak1Var = (ak1) this.L$0;
            s38.b(obj);
            c02972 = this;
            ContentRepository contentRepository = ContentRepository.this;
            ArrayList arrayList = new ArrayList();
            Iterator it = ((List) obj).iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                TraktTrendingMovie traktTrendingMovie = (TraktTrendingMovie) it.next();
                Integer tmdb = traktTrendingMovie.getMovie().getIds().getTmdb();
                r22 r22VarA = tmdb != null ? wj0.a(ak1Var, null, new ContentRepository$fetchTrendingMoviesFromApis$2$1$1(contentRepository, tmdb.intValue(), traktTrendingMovie, null), 3) : null;
                if (r22VarA != null) {
                    arrayList.add(r22VarA);
                }
            }
            c02972.L$0 = null;
            c02972.label = 2;
            obj = i50.a(arrayList, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchTrendingShowsFromApis$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchTrendingShowsFromApis$2", f = "ContentRepository.kt", i = {0}, l = {367, 412}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class C02982 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C02982(int i, int i2, Continuation<? super C02982> continuation) {
            super(2, continuation);
            this.$pageSize = i;
            this.$page = i2;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            C02982 c02982 = ContentRepository.this.new C02982(this.$pageSize, this.$page, continuation);
            c02982.L$0 = obj;
            return c02982;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:22:0x008a, code lost:
        
            if (r12 == r0) goto L23;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            C02982 c02982;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                TraktApiService traktApiService = ContentRepository.this.traktApiService;
                int i2 = this.$pageSize;
                int i3 = this.$page;
                this.L$0 = ak1Var;
                this.label = 1;
                c02982 = this;
                obj = TraktApiService.DefaultImpls.getTrendingShows$default(traktApiService, i2, i3, null, c02982, 4, null);
                if (obj != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return y41.x((Iterable) obj);
            }
            ak1Var = (ak1) this.L$0;
            s38.b(obj);
            c02982 = this;
            ContentRepository contentRepository = ContentRepository.this;
            ArrayList arrayList = new ArrayList();
            Iterator it = ((List) obj).iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                TraktTrendingShow traktTrendingShow = (TraktTrendingShow) it.next();
                Integer tmdb = traktTrendingShow.getShow().getIds().getTmdb();
                r22 r22VarA = tmdb != null ? wj0.a(ak1Var, null, new ContentRepository$fetchTrendingShowsFromApis$2$1$1(contentRepository, tmdb.intValue(), traktTrendingShow, null), 3) : null;
                if (r22VarA != null) {
                    arrayList.add(r22VarA);
                }
            }
            c02982.L$0 = null;
            c02982.label = 2;
            obj = i50.a(arrayList, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$fetchUserListMoviesFromApis$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$fetchUserListMoviesFromApis$2", f = "ContentRepository.kt", i = {0}, l = {658, 704}, m = "invokeSuspend", n = {"$this$withContext"}, s = {"L$0"})
    @vx8
    public static final class C02992 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ String $list;
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        final /* synthetic */ String $user;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C02992(String str, String str2, int i, int i2, Continuation<? super C02992> continuation) {
            super(2, continuation);
            this.$user = str;
            this.$list = str2;
            this.$page = i;
            this.$pageSize = i2;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            C02992 c02992 = ContentRepository.this.new C02992(this.$user, this.$list, this.$page, this.$pageSize, continuation);
            c02992.L$0 = obj;
            return c02992;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:26:0x009d, code lost:
        
            if (r0 == r13) goto L27;
         */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            ak1 ak1Var;
            Object listMovies$default;
            Object objA;
            TraktIds ids;
            Integer tmdb;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                ak1Var = (ak1) this.L$0;
                TraktApiService traktApiService = ContentRepository.this.traktApiService;
                String str = this.$user;
                String str2 = this.$list;
                int i2 = this.$page;
                int i3 = this.$pageSize;
                this.L$0 = ak1Var;
                this.label = 1;
                listMovies$default = TraktApiService.DefaultImpls.getListMovies$default(traktApiService, str, str2, null, null, i2, i3, null, null, null, this, 460, null);
                if (listMovies$default != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                objA = obj;
                return y41.x((Iterable) objA);
            }
            ak1 ak1Var2 = (ak1) this.L$0;
            s38.b(obj);
            ak1Var = ak1Var2;
            listMovies$default = obj;
            ContentRepository contentRepository = ContentRepository.this;
            ArrayList arrayList = new ArrayList();
            Iterator it = ((List) listMovies$default).iterator();
            while (true) {
                r22 r22VarA = null;
                if (!it.hasNext()) {
                    break;
                }
                TraktListItem traktListItem = (TraktListItem) it.next();
                TraktMovie movie = traktListItem.getMovie();
                if (movie != null && (ids = movie.getIds()) != null && (tmdb = ids.getTmdb()) != null) {
                    r22VarA = wj0.a(ak1Var, null, new ContentRepository$fetchUserListMoviesFromApis$2$1$1(contentRepository, tmdb.intValue(), traktListItem, null), 3);
                }
                if (r22VarA != null) {
                    arrayList.add(r22VarA);
                }
            }
            this.L$0 = null;
            this.label = 2;
            objA = i50.a(arrayList, this);
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$getPlaceholderPage$2, reason: invalid class name and case insensitive filesystem */
    @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/ContentItem;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository$getPlaceholderPage$2", f = "ContentRepository.kt", i = {}, l = {152, 156, 160, 164}, m = "invokeSuspend", n = {}, s = {})
    @vx8
    public static final class C03002 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends ContentItem>>, Object> {
        final /* synthetic */ String $category;
        final /* synthetic */ int $page;
        final /* synthetic */ int $pageSize;
        int label;
        final /* synthetic */ ContentRepository this$0;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C03002(String str, ContentRepository contentRepository, int i, int i2, Continuation<? super C03002> continuation) {
            super(2, continuation);
            this.$category = str;
            this.this$0 = contentRepository;
            this.$pageSize = i;
            this.$page = i2;
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
            return new C03002(this.$category, this.this$0, this.$pageSize, this.$page, continuation);
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:21:0x005e, code lost:
        
            if (r12 == r0) goto L58;
         */
        /* JADX WARN: Code restructure failed: missing block: B:33:0x00ab, code lost:
        
            if (r12 == r0) goto L58;
         */
        /* JADX WARN: Code restructure failed: missing block: B:45:0x00f7, code lost:
        
            if (r12 == r0) goto L58;
         */
        /* JADX WARN: Code restructure failed: missing block: B:57:0x0141, code lost:
        
            if (r12 == r0) goto L58;
         */
        /* JADX WARN: Code restructure failed: missing block: B:58:0x0143, code lost:
        
            return r0;
         */
        /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            C03002 c03002;
            C03002 c030022;
            C03002 c030023;
            C03002 c030024;
            List arrayList;
            ck1 ck1Var = ck1.a;
            int i = this.label;
            if (i == 0) {
                s38.b(obj);
                String str = this.$category;
                switch (str.hashCode()) {
                    case -1985298448:
                        if (str.equals(ContentRepository.CATEGORY_POPULAR_SHOWS)) {
                            TraktApiService traktApiService = this.this$0.traktApiService;
                            int i2 = this.$pageSize;
                            int i3 = this.$page;
                            this.label = 4;
                            obj = TraktApiService.DefaultImpls.getPopularShows$default(traktApiService, i2, i3, null, this, 4, null);
                            c03002 = this;
                        }
                        arrayList = ik2.a;
                        break;
                    case -1579825271:
                        c030022 = this;
                        if (str.equals(ContentRepository.CATEGORY_POPULAR_MOVIES)) {
                            TraktApiService traktApiService2 = c030022.this$0.traktApiService;
                            int i4 = c030022.$pageSize;
                            int i5 = c030022.$page;
                            c030022.label = 2;
                            obj = TraktApiService.DefaultImpls.getPopularMovies$default(traktApiService2, i4, i5, null, null, c030022, 12, null);
                        }
                        arrayList = ik2.a;
                        break;
                    case -774951011:
                        c030023 = this;
                        if (str.equals(ContentRepository.CATEGORY_TRENDING_MOVIES)) {
                            TraktApiService traktApiService3 = c030023.this$0.traktApiService;
                            int i6 = c030023.$pageSize;
                            int i7 = c030023.$page;
                            c030023.label = 1;
                            obj = TraktApiService.DefaultImpls.getTrendingMovies$default(traktApiService3, i6, i7, null, null, c030023, 12, null);
                        }
                        arrayList = ik2.a;
                        break;
                    case 395969884:
                        if (str.equals(ContentRepository.CATEGORY_TRENDING_SHOWS)) {
                            TraktApiService traktApiService4 = this.this$0.traktApiService;
                            int i8 = this.$pageSize;
                            int i9 = this.$page;
                            this.label = 3;
                            obj = TraktApiService.DefaultImpls.getTrendingShows$default(traktApiService4, i8, i9, null, this, 4, null);
                            c030024 = this;
                            break;
                        }
                    default:
                        arrayList = ik2.a;
                        break;
                }
            } else if (i == 1) {
                s38.b(obj);
                c030023 = this;
                ContentRepository contentRepository = c030023.this$0;
                arrayList = new ArrayList();
                Iterator it = ((Iterable) obj).iterator();
                while (it.hasNext()) {
                    ContentItem placeholderContentItem = contentRepository.toPlaceholderContentItem(((TraktTrendingMovie) it.next()).getMovie(), ContentItem.ItemType.MOVIE);
                    if (placeholderContentItem != null) {
                        arrayList.add(placeholderContentItem);
                    }
                }
            } else if (i == 2) {
                s38.b(obj);
                c030022 = this;
                ContentRepository contentRepository2 = c030022.this$0;
                arrayList = new ArrayList();
                Iterator it2 = ((Iterable) obj).iterator();
                while (it2.hasNext()) {
                    ContentItem placeholderContentItem2 = contentRepository2.toPlaceholderContentItem((TraktMovie) it2.next(), ContentItem.ItemType.MOVIE);
                    if (placeholderContentItem2 != null) {
                        arrayList.add(placeholderContentItem2);
                    }
                }
            } else if (i == 3) {
                s38.b(obj);
                c030024 = this;
                ContentRepository contentRepository3 = c030024.this$0;
                arrayList = new ArrayList();
                Iterator it3 = ((Iterable) obj).iterator();
                while (it3.hasNext()) {
                    ContentItem placeholderContentItem3 = contentRepository3.toPlaceholderContentItem(((TraktTrendingShow) it3.next()).getShow(), ContentItem.ItemType.TV_SHOW);
                    if (placeholderContentItem3 != null) {
                        arrayList.add(placeholderContentItem3);
                    }
                }
            } else {
                if (i != 4) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                c03002 = this;
                ContentRepository contentRepository4 = c03002.this$0;
                arrayList = new ArrayList();
                Iterator it4 = ((Iterable) obj).iterator();
                while (it4.hasNext()) {
                    ContentItem placeholderContentItem4 = contentRepository4.toPlaceholderContentItem((TraktShow) it4.next(), ContentItem.ItemType.TV_SHOW);
                    if (placeholderContentItem4 != null) {
                        arrayList.add(placeholderContentItem4);
                    }
                }
            }
            HashSet hashSet = new HashSet();
            ArrayList arrayList2 = new ArrayList();
            for (Object obj2 : arrayList) {
                if (hashSet.add(Boxing.boxInt(((ContentItem) obj2).getTmdbId()))) {
                    arrayList2.add(obj2);
                }
            }
            return arrayList2;
        }
    }

    /* JADX INFO: renamed from: com.strmr.ps.data.repository.ContentRepository$prefetchCategoryPage$1, reason: invalid class name */
    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    @DebugMetadata(c = "com.strmr.ps.data.repository.ContentRepository", f = "ContentRepository.kt", i = {}, l = {TsExtractor.TS_STREAM_TYPE_DTS, TsExtractor.TS_STREAM_TYPE_DTS_UHD, 140, 141, 142}, m = "prefetchCategoryPage", n = {}, s = {})
    public static final class AnonymousClass1 extends ContinuationImpl {
        int label;
        /* synthetic */ Object result;

        public AnonymousClass1(Continuation<? super AnonymousClass1> continuation) {
            super(continuation);
        }

        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        @pq6
        public final Object invokeSuspend(@kp6 Object obj) {
            this.result = obj;
            this.label |= Integer.MIN_VALUE;
            return ContentRepository.this.prefetchCategoryPage(null, 0, 0, this);
        }
    }

    @Inject
    public ContentRepository(@kp6 TraktApiService traktApiService, @kp6 TMDBApiService tMDBApiService, @kp6 CacheRepository cacheRepository, @kp6 kg4 kg4Var, @ApplicationContext @kp6 Context context) {
        cr4.g(traktApiService, "traktApiService");
        cr4.g(tMDBApiService, "tmdbApiService");
        cr4.g(cacheRepository, "cacheRepository");
        cr4.g(kg4Var, "watchStatusRepository");
        cr4.g(context, "context");
        this.traktApiService = traktApiService;
        this.tmdbApiService = tMDBApiService;
        this.cacheRepository = cacheRepository;
        this.watchStatusRepository = kg4Var;
        this.context = context;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchMoviesByGenreFromApis(String str, int i, int i2, String str2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new AnonymousClass2(str, i2, i, this, str2, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchPopularMoviesFromApis(int i, int i2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C02942(i2, i, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchPopularShowsFromApis(int i, int i2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C02952(i2, i, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchShowsByGenreFromApis(String str, int i, int i2, String str2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C02962(str, i2, i, this, str2, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchTrendingMoviesFromApis(int i, int i2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C02972(i2, i, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchTrendingShowsFromApis(int i, int i2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C02982(i2, i, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object fetchUserListMoviesFromApis(String str, String str2, int i, int i2, Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C02992(str, str2, i, i2, null), continuation);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final String formatRuntime(Integer minutes) {
        if (minutes == null || minutes.intValue() <= 0) {
            return null;
        }
        if (minutes.intValue() < 60) {
            return minutes + CmcdData.OBJECT_TYPE_MANIFEST;
        }
        return (minutes.intValue() / 60) + "h " + (minutes.intValue() % 60) + CmcdData.OBJECT_TYPE_MANIFEST;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final String getImgLang() {
        LinkedHashMap linkedHashMap = hf5.a;
        return hf5.c(this.context);
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0015  */
    /* JADX INFO: renamed from: getPagedContent-hUnOzRk, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object m80getPagedContenthUnOzRk(String str, int i, int i2, boolean z, sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> sq3Var, Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getPagedContent$1 contentRepository$getPagedContent$1;
        if (continuation instanceof ContentRepository$getPagedContent$1) {
            contentRepository$getPagedContent$1 = (ContentRepository$getPagedContent$1) continuation;
            int i3 = contentRepository$getPagedContent$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getPagedContent$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getPagedContent$1 = new ContentRepository$getPagedContent$1(this, continuation);
            }
        }
        Object objF = contentRepository$getPagedContent$1.result;
        ck1 ck1Var = ck1.a;
        int i4 = contentRepository$getPagedContent$1.label;
        if (i4 == 0) {
            s38.b(objF);
            m12 m12Var = sc2.a;
            m02 m02Var = m02.c;
            ContentRepository$getPagedContent$2 contentRepository$getPagedContent$2 = new ContentRepository$getPagedContent$2(this, str, i, i2, z, sq3Var, null);
            contentRepository$getPagedContent$1.label = 1;
            objF = wj0.f(m02Var, contentRepository$getPagedContent$2, contentRepository$getPagedContent$1);
            if (objF == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(objF);
        }
        return ((q38) objF).a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final String resolveImdbId(String primary, String external, String trakt) {
        return primary == null ? external == null ? trakt : external : primary;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final ContentItem toPlaceholderContentItem(TraktMovie traktMovie, ContentItem.ItemType itemType) {
        Integer tmdb = traktMovie.getIds().getTmdb();
        if (tmdb == null) {
            return null;
        }
        int iIntValue = tmdb.intValue();
        String imdb = traktMovie.getIds().getImdb();
        String title = traktMovie.getTitle();
        Integer year = traktMovie.getYear();
        String string = year != null ? year.toString() : null;
        Double rating = traktMovie.getRating();
        Double rating2 = traktMovie.getRating();
        return new ContentItem(iIntValue, itemType, iIntValue, imdb, title, null, null, null, null, null, string, rating, rating2 != null ? Integer.valueOf((int) (rating2.doubleValue() * ((double) 10))) : null, null, null, null, null, null, null, traktMovie.getRating(), null, null, null, null, false, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, -2096640, 2047, null);
    }

    @pq6
    public Object cleanupCache(@kp6 Continuation<? super e6a> continuation) throws Throwable {
        Object objCleanupOldCache = this.cacheRepository.cleanupOldCache(continuation);
        return objCleanupOldCache == ck1.a ? objCleanupOldCache : e6a.a;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @pq6
    /* JADX INFO: renamed from: getLatest4KMovies-gIAlu-s, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m81getLatest4KMoviesgIAlus(boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getLatest4KMovies$1 contentRepository$getLatest4KMovies$1;
        if (continuation instanceof ContentRepository$getLatest4KMovies$1) {
            contentRepository$getLatest4KMovies$1 = (ContentRepository$getLatest4KMovies$1) continuation;
            int i = contentRepository$getLatest4KMovies$1.label;
            if ((i & Integer.MIN_VALUE) != 0) {
                contentRepository$getLatest4KMovies$1.label = i - Integer.MIN_VALUE;
            } else {
                contentRepository$getLatest4KMovies$1 = new ContentRepository$getLatest4KMovies$1(this, continuation);
            }
        }
        Object obj = contentRepository$getLatest4KMovies$1.result;
        Object obj2 = ck1.a;
        int i2 = contentRepository$getLatest4KMovies$1.label;
        if (i2 != 0) {
            if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        contentRepository$getLatest4KMovies$1.label = 1;
        Object objMo82getLatest4KMoviesPageBWLJW6A = mo82getLatest4KMoviesPageBWLJW6A(1, 20, z, contentRepository$getLatest4KMovies$1);
        return objMo82getLatest4KMoviesPageBWLJW6A == obj2 ? obj2 : objMo82getLatest4KMoviesPageBWLJW6A;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0014  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getLatest4KMoviesPage-BWLJW6A, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo82getLatest4KMoviesPageBWLJW6A(int i, int i2, boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getLatest4KMoviesPage$1 contentRepository$getLatest4KMoviesPage$1;
        if (continuation instanceof ContentRepository$getLatest4KMoviesPage$1) {
            contentRepository$getLatest4KMoviesPage$1 = (ContentRepository$getLatest4KMoviesPage$1) continuation;
            int i3 = contentRepository$getLatest4KMoviesPage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getLatest4KMoviesPage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getLatest4KMoviesPage$1 = new ContentRepository$getLatest4KMoviesPage$1(this, continuation);
            }
        }
        ContentRepository$getLatest4KMoviesPage$1 contentRepository$getLatest4KMoviesPage$12 = contentRepository$getLatest4KMoviesPage$1;
        Object obj = contentRepository$getLatest4KMoviesPage$12.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getLatest4KMoviesPage$12.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getLatest4KMoviesPage$2 = new ContentRepository$getLatest4KMoviesPage$2(this, i, i2, null);
        contentRepository$getLatest4KMoviesPage$12.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(CATEGORY_LATEST_4K_MOVIES, i, i2, z, contentRepository$getLatest4KMoviesPage$2, contentRepository$getLatest4KMoviesPage$12);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    @pq6
    /* JADX INFO: renamed from: getMovieDetailsBundle-gIAlu-s, reason: not valid java name */
    public final Object m83getMovieDetailsBundlegIAlus(int i, @kp6 Continuation<? super q38<MovieDetailsBundle>> continuation) {
        return s38.a(new UnsupportedOperationException("getMovieDetailsBundle not implemented"));
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0015  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getMoviesByGenrePage-bMdYcbs, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo84getMoviesByGenrePagebMdYcbs(@kp6 String str, int i, int i2, boolean z, @pq6 String str2, @pq6 String str3, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getMoviesByGenrePage$1 contentRepository$getMoviesByGenrePage$1;
        if (continuation instanceof ContentRepository$getMoviesByGenrePage$1) {
            contentRepository$getMoviesByGenrePage$1 = (ContentRepository$getMoviesByGenrePage$1) continuation;
            int i3 = contentRepository$getMoviesByGenrePage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getMoviesByGenrePage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getMoviesByGenrePage$1 = new ContentRepository$getMoviesByGenrePage$1(this, continuation);
            }
        }
        Object obj = contentRepository$getMoviesByGenrePage$1.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getMoviesByGenrePage$1.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        List list = zw8.a;
        String strF = zw8.f(str2 == null ? "popularity" : str2, str3 == null ? "desc" : str3, false);
        if (strF == null) {
            strF = "popularity.desc";
        }
        String str4 = strF;
        Locale locale = Locale.ROOT;
        String upperCase = str.toUpperCase(locale);
        cr4.f(upperCase, "toUpperCase(...)");
        String upperCase2 = str4.toUpperCase(locale);
        cr4.f(upperCase2, "toUpperCase(...)");
        String strH = fi7.h(CATEGORY_GENRE_MOVIES_PREFIX, upperCase, "_", upperCase2);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getMoviesByGenrePage$2 = new ContentRepository$getMoviesByGenrePage$2(this, str, i, i2, str4, null);
        contentRepository$getMoviesByGenrePage$1.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(strH, i, i2, z, contentRepository$getMoviesByGenrePage$2, contentRepository$getMoviesByGenrePage$1);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    @pq6
    public Object getPlaceholderPage(@kp6 String str, int i, int i2, @kp6 Continuation<? super List<ContentItem>> continuation) {
        m12 m12Var = sc2.a;
        return wj0.f(m02.c, new C03002(str, this, i2, i, null), continuation);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @pq6
    /* JADX INFO: renamed from: getPopularMovies-gIAlu-s, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m85getPopularMoviesgIAlus(boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) {
        ContentRepository$getPopularMovies$1 contentRepository$getPopularMovies$1;
        if (continuation instanceof ContentRepository$getPopularMovies$1) {
            contentRepository$getPopularMovies$1 = (ContentRepository$getPopularMovies$1) continuation;
            int i = contentRepository$getPopularMovies$1.label;
            if ((i & Integer.MIN_VALUE) != 0) {
                contentRepository$getPopularMovies$1.label = i - Integer.MIN_VALUE;
            } else {
                contentRepository$getPopularMovies$1 = new ContentRepository$getPopularMovies$1(this, continuation);
            }
        }
        Object obj = contentRepository$getPopularMovies$1.result;
        Object obj2 = ck1.a;
        int i2 = contentRepository$getPopularMovies$1.label;
        if (i2 != 0) {
            if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        contentRepository$getPopularMovies$1.label = 1;
        Object objMo86getPopularMoviesPageBWLJW6A = mo86getPopularMoviesPageBWLJW6A(1, 20, z, contentRepository$getPopularMovies$1);
        return objMo86getPopularMoviesPageBWLJW6A == obj2 ? obj2 : objMo86getPopularMoviesPageBWLJW6A;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0014  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getPopularMoviesPage-BWLJW6A, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo86getPopularMoviesPageBWLJW6A(int i, int i2, boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getPopularMoviesPage$1 contentRepository$getPopularMoviesPage$1;
        if (continuation instanceof ContentRepository$getPopularMoviesPage$1) {
            contentRepository$getPopularMoviesPage$1 = (ContentRepository$getPopularMoviesPage$1) continuation;
            int i3 = contentRepository$getPopularMoviesPage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getPopularMoviesPage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getPopularMoviesPage$1 = new ContentRepository$getPopularMoviesPage$1(this, continuation);
            }
        }
        ContentRepository$getPopularMoviesPage$1 contentRepository$getPopularMoviesPage$12 = contentRepository$getPopularMoviesPage$1;
        Object obj = contentRepository$getPopularMoviesPage$12.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getPopularMoviesPage$12.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getPopularMoviesPage$2 = new ContentRepository$getPopularMoviesPage$2(this, i, i2, null);
        contentRepository$getPopularMoviesPage$12.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(CATEGORY_POPULAR_MOVIES, i, i2, z, contentRepository$getPopularMoviesPage$2, contentRepository$getPopularMoviesPage$12);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @pq6
    /* JADX INFO: renamed from: getPopularShows-gIAlu-s, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m87getPopularShowsgIAlus(boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) {
        ContentRepository$getPopularShows$1 contentRepository$getPopularShows$1;
        if (continuation instanceof ContentRepository$getPopularShows$1) {
            contentRepository$getPopularShows$1 = (ContentRepository$getPopularShows$1) continuation;
            int i = contentRepository$getPopularShows$1.label;
            if ((i & Integer.MIN_VALUE) != 0) {
                contentRepository$getPopularShows$1.label = i - Integer.MIN_VALUE;
            } else {
                contentRepository$getPopularShows$1 = new ContentRepository$getPopularShows$1(this, continuation);
            }
        }
        Object obj = contentRepository$getPopularShows$1.result;
        Object obj2 = ck1.a;
        int i2 = contentRepository$getPopularShows$1.label;
        if (i2 != 0) {
            if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        contentRepository$getPopularShows$1.label = 1;
        Object objMo88getPopularShowsPageBWLJW6A = mo88getPopularShowsPageBWLJW6A(1, 20, z, contentRepository$getPopularShows$1);
        return objMo88getPopularShowsPageBWLJW6A == obj2 ? obj2 : objMo88getPopularShowsPageBWLJW6A;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0014  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getPopularShowsPage-BWLJW6A, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo88getPopularShowsPageBWLJW6A(int i, int i2, boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getPopularShowsPage$1 contentRepository$getPopularShowsPage$1;
        if (continuation instanceof ContentRepository$getPopularShowsPage$1) {
            contentRepository$getPopularShowsPage$1 = (ContentRepository$getPopularShowsPage$1) continuation;
            int i3 = contentRepository$getPopularShowsPage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getPopularShowsPage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getPopularShowsPage$1 = new ContentRepository$getPopularShowsPage$1(this, continuation);
            }
        }
        ContentRepository$getPopularShowsPage$1 contentRepository$getPopularShowsPage$12 = contentRepository$getPopularShowsPage$1;
        Object obj = contentRepository$getPopularShowsPage$12.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getPopularShowsPage$12.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getPopularShowsPage$2 = new ContentRepository$getPopularShowsPage$2(this, i, i2, null);
        contentRepository$getPopularShowsPage$12.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(CATEGORY_POPULAR_SHOWS, i, i2, z, contentRepository$getPopularShowsPage$2, contentRepository$getPopularShowsPage$12);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    @pq6
    /* JADX INFO: renamed from: getShowDetailsBundle-gIAlu-s, reason: not valid java name */
    public final Object m89getShowDetailsBundlegIAlus(int i, @kp6 Continuation<? super q38<ShowDetailsBundle>> continuation) {
        return s38.a(new UnsupportedOperationException("getShowDetailsBundle not implemented"));
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0015  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getShowsByGenrePage-bMdYcbs, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo90getShowsByGenrePagebMdYcbs(@kp6 String str, int i, int i2, boolean z, @pq6 String str2, @pq6 String str3, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getShowsByGenrePage$1 contentRepository$getShowsByGenrePage$1;
        if (continuation instanceof ContentRepository$getShowsByGenrePage$1) {
            contentRepository$getShowsByGenrePage$1 = (ContentRepository$getShowsByGenrePage$1) continuation;
            int i3 = contentRepository$getShowsByGenrePage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getShowsByGenrePage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getShowsByGenrePage$1 = new ContentRepository$getShowsByGenrePage$1(this, continuation);
            }
        }
        Object obj = contentRepository$getShowsByGenrePage$1.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getShowsByGenrePage$1.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        List list = zw8.a;
        String strF = zw8.f(str2 == null ? "popularity" : str2, str3 == null ? "desc" : str3, true);
        if (strF == null) {
            strF = "popularity.desc";
        }
        String str4 = strF;
        Locale locale = Locale.ROOT;
        String upperCase = str.toUpperCase(locale);
        cr4.f(upperCase, "toUpperCase(...)");
        String upperCase2 = str4.toUpperCase(locale);
        cr4.f(upperCase2, "toUpperCase(...)");
        String strH = fi7.h(CATEGORY_GENRE_SHOWS_PREFIX, upperCase, "_", upperCase2);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getShowsByGenrePage$2 = new ContentRepository$getShowsByGenrePage$2(this, str, i, i2, str4, null);
        contentRepository$getShowsByGenrePage$1.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(strH, i, i2, z, contentRepository$getShowsByGenrePage$2, contentRepository$getShowsByGenrePage$1);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @pq6
    /* JADX INFO: renamed from: getTrendingMovies-gIAlu-s, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m91getTrendingMoviesgIAlus(boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) {
        ContentRepository$getTrendingMovies$1 contentRepository$getTrendingMovies$1;
        if (continuation instanceof ContentRepository$getTrendingMovies$1) {
            contentRepository$getTrendingMovies$1 = (ContentRepository$getTrendingMovies$1) continuation;
            int i = contentRepository$getTrendingMovies$1.label;
            if ((i & Integer.MIN_VALUE) != 0) {
                contentRepository$getTrendingMovies$1.label = i - Integer.MIN_VALUE;
            } else {
                contentRepository$getTrendingMovies$1 = new ContentRepository$getTrendingMovies$1(this, continuation);
            }
        }
        Object obj = contentRepository$getTrendingMovies$1.result;
        Object obj2 = ck1.a;
        int i2 = contentRepository$getTrendingMovies$1.label;
        if (i2 != 0) {
            if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        contentRepository$getTrendingMovies$1.label = 1;
        Object objMo92getTrendingMoviesPageBWLJW6A = mo92getTrendingMoviesPageBWLJW6A(1, 20, z, contentRepository$getTrendingMovies$1);
        return objMo92getTrendingMoviesPageBWLJW6A == obj2 ? obj2 : objMo92getTrendingMoviesPageBWLJW6A;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0014  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getTrendingMoviesPage-BWLJW6A, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo92getTrendingMoviesPageBWLJW6A(int i, int i2, boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getTrendingMoviesPage$1 contentRepository$getTrendingMoviesPage$1;
        if (continuation instanceof ContentRepository$getTrendingMoviesPage$1) {
            contentRepository$getTrendingMoviesPage$1 = (ContentRepository$getTrendingMoviesPage$1) continuation;
            int i3 = contentRepository$getTrendingMoviesPage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getTrendingMoviesPage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getTrendingMoviesPage$1 = new ContentRepository$getTrendingMoviesPage$1(this, continuation);
            }
        }
        ContentRepository$getTrendingMoviesPage$1 contentRepository$getTrendingMoviesPage$12 = contentRepository$getTrendingMoviesPage$1;
        Object obj = contentRepository$getTrendingMoviesPage$12.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getTrendingMoviesPage$12.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getTrendingMoviesPage$2 = new ContentRepository$getTrendingMoviesPage$2(this, i, i2, null);
        contentRepository$getTrendingMoviesPage$12.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(CATEGORY_TRENDING_MOVIES, i, i2, z, contentRepository$getTrendingMoviesPage$2, contentRepository$getTrendingMoviesPage$12);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @pq6
    /* JADX INFO: renamed from: getTrendingShows-gIAlu-s, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m93getTrendingShowsgIAlus(boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) {
        ContentRepository$getTrendingShows$1 contentRepository$getTrendingShows$1;
        if (continuation instanceof ContentRepository$getTrendingShows$1) {
            contentRepository$getTrendingShows$1 = (ContentRepository$getTrendingShows$1) continuation;
            int i = contentRepository$getTrendingShows$1.label;
            if ((i & Integer.MIN_VALUE) != 0) {
                contentRepository$getTrendingShows$1.label = i - Integer.MIN_VALUE;
            } else {
                contentRepository$getTrendingShows$1 = new ContentRepository$getTrendingShows$1(this, continuation);
            }
        }
        Object obj = contentRepository$getTrendingShows$1.result;
        Object obj2 = ck1.a;
        int i2 = contentRepository$getTrendingShows$1.label;
        if (i2 != 0) {
            if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        contentRepository$getTrendingShows$1.label = 1;
        Object objMo94getTrendingShowsPageBWLJW6A = mo94getTrendingShowsPageBWLJW6A(1, 20, z, contentRepository$getTrendingShows$1);
        return objMo94getTrendingShowsPageBWLJW6A == obj2 ? obj2 : objMo94getTrendingShowsPageBWLJW6A;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0014  */
    @Override // defpackage.kf4
    @pq6
    /* JADX INFO: renamed from: getTrendingShowsPage-BWLJW6A, reason: not valid java name */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object mo94getTrendingShowsPageBWLJW6A(int i, int i2, boolean z, @kp6 Continuation<? super q38<? extends List<ContentItem>>> continuation) throws Throwable {
        ContentRepository$getTrendingShowsPage$1 contentRepository$getTrendingShowsPage$1;
        if (continuation instanceof ContentRepository$getTrendingShowsPage$1) {
            contentRepository$getTrendingShowsPage$1 = (ContentRepository$getTrendingShowsPage$1) continuation;
            int i3 = contentRepository$getTrendingShowsPage$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                contentRepository$getTrendingShowsPage$1.label = i3 - Integer.MIN_VALUE;
            } else {
                contentRepository$getTrendingShowsPage$1 = new ContentRepository$getTrendingShowsPage$1(this, continuation);
            }
        }
        ContentRepository$getTrendingShowsPage$1 contentRepository$getTrendingShowsPage$12 = contentRepository$getTrendingShowsPage$1;
        Object obj = contentRepository$getTrendingShowsPage$12.result;
        Object obj2 = ck1.a;
        int i4 = contentRepository$getTrendingShowsPage$12.label;
        if (i4 != 0) {
            if (i4 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return ((q38) obj).a;
        }
        s38.b(obj);
        sq3<? super Continuation<? super List<ContentItem>>, ? extends Object> contentRepository$getTrendingShowsPage$2 = new ContentRepository$getTrendingShowsPage$2(this, i, i2, null);
        contentRepository$getTrendingShowsPage$12.label = 1;
        Object objM80getPagedContenthUnOzRk = m80getPagedContenthUnOzRk(CATEGORY_TRENDING_SHOWS, i, i2, z, contentRepository$getTrendingShowsPage$2, contentRepository$getTrendingShowsPage$12);
        return objM80getPagedContenthUnOzRk == obj2 ? obj2 : objM80getPagedContenthUnOzRk;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:61:0x00db A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @pq6
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object prefetchCategoryPage(@kp6 String str, int i, int i2, @kp6 Continuation<? super e6a> continuation) {
        AnonymousClass1 anonymousClass1;
        if (continuation instanceof AnonymousClass1) {
            anonymousClass1 = (AnonymousClass1) continuation;
            int i3 = anonymousClass1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                anonymousClass1.label = i3 - Integer.MIN_VALUE;
            } else {
                anonymousClass1 = new AnonymousClass1(continuation);
            }
        }
        Object obj = anonymousClass1.result;
        Object obj2 = ck1.a;
        int i4 = anonymousClass1.label;
        e6a e6aVar = e6a.a;
        if (i4 != 0) {
            if (i4 == 1) {
                s38.b(obj);
                ((q38) obj).getClass();
                return e6aVar;
            }
            if (i4 == 2) {
                s38.b(obj);
                ((q38) obj).getClass();
                return e6aVar;
            }
            if (i4 == 3) {
                s38.b(obj);
                ((q38) obj).getClass();
                return e6aVar;
            }
            if (i4 == 4) {
                s38.b(obj);
                ((q38) obj).getClass();
            }
            if (i4 != 5) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            ((q38) obj).getClass();
            return e6aVar;
        }
        s38.b(obj);
        if (cr4.b(str, CATEGORY_CONTINUE_WATCHING)) {
            return e6aVar;
        }
        switch (str.hashCode()) {
            case -1985298448:
                if (str.equals(CATEGORY_POPULAR_SHOWS)) {
                    anonymousClass1.label = 4;
                    return mo88getPopularShowsPageBWLJW6A(i, i2, false, anonymousClass1) == obj2 ? obj2 : e6aVar;
                }
                return e6aVar;
            case -1579825271:
                if (str.equals(CATEGORY_POPULAR_MOVIES)) {
                    anonymousClass1.label = 2;
                    if (mo86getPopularMoviesPageBWLJW6A(i, i2, false, anonymousClass1) != obj2) {
                        return e6aVar;
                    }
                }
                return e6aVar;
            case -774951011:
                if (str.equals(CATEGORY_TRENDING_MOVIES)) {
                    anonymousClass1.label = 1;
                    if (mo92getTrendingMoviesPageBWLJW6A(i, i2, false, anonymousClass1) != obj2) {
                        return e6aVar;
                    }
                }
                return e6aVar;
            case -449557709:
                if (str.equals(CATEGORY_LATEST_4K_MOVIES)) {
                    anonymousClass1.label = 5;
                    if (mo82getLatest4KMoviesPageBWLJW6A(i, i2, false, anonymousClass1) != obj2) {
                        return e6aVar;
                    }
                }
                return e6aVar;
            case 395969884:
                if (str.equals(CATEGORY_TRENDING_SHOWS)) {
                    anonymousClass1.label = 3;
                    if (mo94getTrendingShowsPageBWLJW6A(i, i2, false, anonymousClass1) != obj2) {
                        return e6aVar;
                    }
                }
                return e6aVar;
            default:
                return e6aVar;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final ContentItem toPlaceholderContentItem(TraktShow traktShow, ContentItem.ItemType itemType) {
        Integer tmdb = traktShow.getIds().getTmdb();
        if (tmdb == null) {
            return null;
        }
        int iIntValue = tmdb.intValue();
        String imdb = traktShow.getIds().getImdb();
        String title = traktShow.getTitle();
        Integer year = traktShow.getYear();
        String string = year != null ? year.toString() : null;
        Double rating = traktShow.getRating();
        Double rating2 = traktShow.getRating();
        return new ContentItem(iIntValue, itemType, iIntValue, imdb, title, null, null, null, null, null, string, rating, rating2 != null ? Integer.valueOf((int) (rating2.doubleValue() * ((double) 10))) : null, null, null, null, null, null, null, traktShow.getRating(), null, null, null, null, false, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, -2096640, 2047, null);
    }
}
