package com.martsnew.domain.model;

import B6.k;
import B6.t;
import M5.b;
import P6.g;
import X6.e;
import android.os.Parcel;
import android.os.Parcelable;
import com.martsnew.domain.type.MediaType;
import d5.AbstractC0844a;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import k5.l;

/* JADX INFO: loaded from: classes.dex */
public final class Movie implements Parcelable {
    public static final Parcelable.Creator<Movie> CREATOR = new l(0);

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final boolean f11056A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final int f11057B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public final int f11058C;
    public final String D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public final double f11059E;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public final long f11060F;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public final List f11061G;
    public final List H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public final List f11062I;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public final List f11063J;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public final ArrayList f11064K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public boolean f11065L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public final Vote f11066M;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public String f11067N;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public String f11068O;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final long f11069q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final String f11070r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final String f11071s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final String f11072t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final String f11073u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final String f11074v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final int f11075w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final MediaType f11076x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public final String f11077y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public final String f11078z;

    public Movie() {
        this(0L, (String) null, (String) null, (String) null, (String) null, (String) null, 0, (MediaType) null, (String) null, (String) null, false, 0, 0, (String) null, 0.0d, 0L, (List) null, (List) null, (List) null, (List) null, false, (Vote) null, 8388607);
    }

    public final String a() {
        if (this.H.isEmpty()) {
            return this.f11067N;
        }
        return k.m0(this.H, null, null, null, new b(12), 31);
    }

    public final String d() {
        if (this.f11061G.isEmpty()) {
            return this.f11068O;
        }
        return k.m0(this.f11061G, null, null, null, new b(11), 31);
    }

    @Override // android.os.Parcelable
    public final int describeContents() {
        return 0;
    }

    public final String e() {
        String str = this.f11074v;
        g.e(str, "<this>");
        if (e.V(str)) {
            return "N/A";
        }
        try {
            Date date = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(str);
            if (date == null) {
                return "N/A";
            }
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(date);
            return String.valueOf(calendar.get(1));
        } catch (Exception unused) {
            return "N/A";
        }
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Movie)) {
            return false;
        }
        Movie movie = (Movie) obj;
        return this.f11069q == movie.f11069q && g.a(this.f11070r, movie.f11070r) && g.a(this.f11071s, movie.f11071s) && g.a(this.f11072t, movie.f11072t) && g.a(this.f11073u, movie.f11073u) && g.a(this.f11074v, movie.f11074v) && this.f11075w == movie.f11075w && this.f11076x == movie.f11076x && g.a(this.f11077y, movie.f11077y) && g.a(this.f11078z, movie.f11078z) && this.f11056A == movie.f11056A && this.f11057B == movie.f11057B && this.f11058C == movie.f11058C && g.a(this.D, movie.D) && Double.compare(this.f11059E, movie.f11059E) == 0 && this.f11060F == movie.f11060F && g.a(this.f11061G, movie.f11061G) && g.a(this.H, movie.H) && g.a(this.f11062I, movie.f11062I) && g.a(this.f11063J, movie.f11063J) && g.a(this.f11064K, movie.f11064K) && this.f11065L == movie.f11065L && g.a(this.f11066M, movie.f11066M);
    }

    public final int hashCode() {
        long j8 = this.f11069q;
        int iG = AbstractC0844a.g((((((AbstractC0844a.g(AbstractC0844a.g((this.f11076x.hashCode() + ((AbstractC0844a.g(AbstractC0844a.g(AbstractC0844a.g(AbstractC0844a.g(AbstractC0844a.g(((int) (j8 ^ (j8 >>> 32))) * 31, 31, this.f11070r), 31, this.f11071s), 31, this.f11072t), 31, this.f11073u), 31, this.f11074v) + this.f11075w) * 31)) * 31, 31, this.f11077y), 31, this.f11078z) + (this.f11056A ? 1231 : 1237)) * 31) + this.f11057B) * 31) + this.f11058C) * 31, 31, this.D);
        long jDoubleToLongBits = Double.doubleToLongBits(this.f11059E);
        int i = (iG + ((int) (jDoubleToLongBits ^ (jDoubleToLongBits >>> 32)))) * 31;
        long j9 = this.f11060F;
        int iHashCode = (this.H.hashCode() + ((this.f11061G.hashCode() + ((i + ((int) ((j9 >>> 32) ^ j9))) * 31)) * 31)) * 31;
        List list = this.f11062I;
        int iHashCode2 = (iHashCode + (list == null ? 0 : list.hashCode())) * 31;
        List list2 = this.f11063J;
        int iHashCode3 = (iHashCode2 + (list2 == null ? 0 : list2.hashCode())) * 31;
        ArrayList arrayList = this.f11064K;
        int iHashCode4 = (((iHashCode3 + (arrayList == null ? 0 : arrayList.hashCode())) * 31) + (this.f11065L ? 1231 : 1237)) * 31;
        Vote vote = this.f11066M;
        return iHashCode4 + (vote != null ? vote.hashCode() : 0);
    }

    public final String toString() {
        return "Movie(id=" + this.f11069q + ", backdropPath=" + this.f11070r + ", posterPath=" + this.f11071s + ", title=" + this.f11072t + ", overview=" + this.f11073u + ", releaseDate=" + this.f11074v + ", runtime=" + this.f11075w + ", type=" + this.f11076x + ", slug=" + this.f11077y + ", trailer=" + this.f11078z + ", infoCompleted=" + this.f11056A + ", latestSeason=" + this.f11057B + ", latestEpisode=" + this.f11058C + ", quality=" + this.D + ", imdbRating=" + this.f11059E + ", updateAt=" + this.f11060F + ", genres=" + this.f11061G + ", countries=" + this.H + ", cast=" + this.f11062I + ", companies=" + this.f11063J + ", seasons=" + this.f11064K + ", inWatchList=" + this.f11065L + ", vote=" + this.f11066M + ")";
    }

    @Override // android.os.Parcelable
    public final void writeToParcel(Parcel parcel, int i) {
        g.e(parcel, "dest");
        parcel.writeLong(this.f11069q);
        parcel.writeString(this.f11070r);
        parcel.writeString(this.f11071s);
        parcel.writeString(this.f11072t);
        parcel.writeString(this.f11073u);
        parcel.writeString(this.f11074v);
        parcel.writeInt(this.f11075w);
        parcel.writeString(this.f11076x.name());
        parcel.writeString(this.f11077y);
        parcel.writeString(this.f11078z);
        parcel.writeInt(this.f11056A ? 1 : 0);
        parcel.writeInt(this.f11057B);
        parcel.writeInt(this.f11058C);
        parcel.writeString(this.D);
        parcel.writeDouble(this.f11059E);
        parcel.writeLong(this.f11060F);
        List list = this.f11061G;
        parcel.writeInt(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            ((Genre) it.next()).writeToParcel(parcel, i);
        }
        List list2 = this.H;
        parcel.writeInt(list2.size());
        Iterator it2 = list2.iterator();
        while (it2.hasNext()) {
            ((Country) it2.next()).writeToParcel(parcel, i);
        }
        List list3 = this.f11062I;
        if (list3 == null) {
            parcel.writeInt(0);
        } else {
            parcel.writeInt(1);
            parcel.writeInt(list3.size());
            Iterator it3 = list3.iterator();
            while (it3.hasNext()) {
                ((Cast) it3.next()).writeToParcel(parcel, i);
            }
        }
        List list4 = this.f11063J;
        if (list4 == null) {
            parcel.writeInt(0);
        } else {
            parcel.writeInt(1);
            parcel.writeInt(list4.size());
            Iterator it4 = list4.iterator();
            while (it4.hasNext()) {
                ((Company) it4.next()).writeToParcel(parcel, i);
            }
        }
        ArrayList arrayList = this.f11064K;
        if (arrayList == null) {
            parcel.writeInt(0);
        } else {
            parcel.writeInt(1);
            parcel.writeInt(arrayList.size());
            int size = arrayList.size();
            int i5 = 0;
            while (i5 < size) {
                Object obj = arrayList.get(i5);
                i5++;
                ((Season) obj).writeToParcel(parcel, i);
            }
        }
        parcel.writeInt(this.f11065L ? 1 : 0);
        Vote vote = this.f11066M;
        if (vote == null) {
            parcel.writeInt(0);
        } else {
            parcel.writeInt(1);
            vote.writeToParcel(parcel, i);
        }
    }

    public Movie(long j8, String str, String str2, String str3, String str4, String str5, int i, MediaType mediaType, String str6, String str7, boolean z8, int i5, int i8, String str8, double d8, long j9, List list, List list2, List list3, List list4, ArrayList arrayList, boolean z9, Vote vote) {
        g.e(str, "backdropPath");
        g.e(str2, "posterPath");
        g.e(str3, "title");
        g.e(str4, "overview");
        g.e(str5, "releaseDate");
        g.e(mediaType, "type");
        g.e(str6, "slug");
        g.e(str7, "trailer");
        g.e(str8, "quality");
        g.e(list, "genres");
        g.e(list2, "countries");
        this.f11069q = j8;
        this.f11070r = str;
        this.f11071s = str2;
        this.f11072t = str3;
        this.f11073u = str4;
        this.f11074v = str5;
        this.f11075w = i;
        this.f11076x = mediaType;
        this.f11077y = str6;
        this.f11078z = str7;
        this.f11056A = z8;
        this.f11057B = i5;
        this.f11058C = i8;
        this.D = str8;
        this.f11059E = d8;
        this.f11060F = j9;
        this.f11061G = list;
        this.H = list2;
        this.f11062I = list3;
        this.f11063J = list4;
        this.f11064K = arrayList;
        this.f11065L = z9;
        this.f11066M = vote;
        this.f11067N = "";
        this.f11068O = "";
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public /* synthetic */ Movie(long j8, String str, String str2, String str3, String str4, String str5, int i, MediaType mediaType, String str6, String str7, boolean z8, int i5, int i8, String str8, double d8, long j9, List list, List list2, List list3, List list4, boolean z9, Vote vote, int i9) {
        long j10 = (i9 & 1) != 0 ? 0L : j8;
        String str9 = (i9 & 2) != 0 ? "" : str;
        String str10 = (i9 & 4) != 0 ? "" : str2;
        String str11 = (i9 & 8) != 0 ? "" : str3;
        String str12 = (i9 & 16) != 0 ? "" : str4;
        String str13 = (i9 & 32) != 0 ? "" : str5;
        int i10 = (i9 & 64) != 0 ? 0 : i;
        MediaType mediaType2 = (i9 & 128) != 0 ? MediaType.f11105r : mediaType;
        String str14 = (i9 & 256) != 0 ? "" : str6;
        String str15 = (i9 & 512) != 0 ? "" : str7;
        boolean z10 = (i9 & 1024) != 0 ? false : z8;
        int i11 = (i9 & 2048) != 0 ? 0 : i5;
        int i12 = (i9 & 4096) != 0 ? 0 : i8;
        String str16 = (i9 & 8192) != 0 ? "" : str8;
        double d9 = (i9 & 16384) != 0 ? 0.0d : d8;
        long j11 = (32768 & i9) != 0 ? 0L : j9;
        int i13 = 65536 & i9;
        t tVar = t.f1032q;
        this(j10, str9, str10, str11, str12, str13, i10, mediaType2, str14, str15, z10, i11, i12, str16, d9, j11, i13 != 0 ? tVar : list, (131072 & i9) != 0 ? tVar : list2, (262144 & i9) != 0 ? null : list3, (524288 & i9) != 0 ? null : list4, (ArrayList) null, (2097152 & i9) != 0 ? false : z9, (i9 & 4194304) != 0 ? null : vote);
    }
}
