package vf;

import xyz.stream.api.database.entity.LiveFavorite;
import xyz.stream.api.database.entity.LiveHistory;

/* JADX INFO: loaded from: classes3.dex */
public final class q extends androidx.room.g {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f33987a;

    public final void a(k3.c cVar, LiveFavorite liveFavorite) {
        switch (this.f33987a) {
            case 1:
                if (liveFavorite.getId() != null) {
                    cVar.a(1, liveFavorite.getId().intValue());
                } else {
                    cVar.d(1);
                }
                break;
            default:
                if (liveFavorite.getId() == null) {
                    cVar.d(1);
                } else {
                    cVar.a(1, liveFavorite.getId().intValue());
                }
                if (liveFavorite.getChannelId() == null) {
                    cVar.d(2);
                } else {
                    cVar.a(2, liveFavorite.getChannelId().intValue());
                }
                if (liveFavorite.getTvgName() == null) {
                    cVar.d(3);
                } else {
                    cVar.s(3, liveFavorite.getTvgName());
                }
                if (liveFavorite.getTvgLogo() == null) {
                    cVar.d(4);
                } else {
                    cVar.s(4, liveFavorite.getTvgLogo());
                }
                if (liveFavorite.getGroupId() == null) {
                    cVar.d(5);
                } else {
                    cVar.a(5, liveFavorite.getGroupId().intValue());
                }
                if (liveFavorite.getGroupTitle() == null) {
                    cVar.d(6);
                } else {
                    cVar.s(6, liveFavorite.getGroupTitle());
                }
                if (liveFavorite.getExtra() == null) {
                    cVar.d(7);
                } else {
                    cVar.s(7, liveFavorite.getExtra());
                }
                if (liveFavorite.getRegion() == null) {
                    cVar.d(8);
                } else {
                    cVar.s(8, liveFavorite.getRegion());
                }
                if (liveFavorite.getUrl() == null) {
                    cVar.d(9);
                } else {
                    cVar.s(9, liveFavorite.getUrl());
                }
                if (liveFavorite.getUpdatedAt() == null) {
                    cVar.d(10);
                } else {
                    cVar.a(10, liveFavorite.getUpdatedAt().intValue());
                }
                if (liveFavorite.getRoleId() == null) {
                    cVar.d(11);
                } else {
                    cVar.s(11, liveFavorite.getRoleId());
                }
                if (liveFavorite.getUpdateDate() == null) {
                    cVar.d(12);
                } else {
                    cVar.s(12, liveFavorite.getUpdateDate());
                }
                if (liveFavorite.getIsPremium() == null) {
                    cVar.d(13);
                } else {
                    cVar.a(13, liveFavorite.getIsPremium().intValue());
                }
                if (liveFavorite.getIsIptv() == null) {
                    cVar.d(14);
                } else {
                    cVar.a(14, liveFavorite.getIsIptv().intValue());
                }
                if (liveFavorite.getProtocol() == null) {
                    cVar.d(15);
                } else {
                    cVar.a(15, liveFavorite.getProtocol().intValue());
                }
                if (liveFavorite.getContentRating() == null) {
                    cVar.d(16);
                } else {
                    cVar.s(16, liveFavorite.getContentRating());
                }
                if (liveFavorite.getBackupTurboUrl() == null) {
                    cVar.d(17);
                } else {
                    cVar.s(17, liveFavorite.getBackupTurboUrl());
                }
                if (liveFavorite.getEpgUrl() == null) {
                    cVar.d(18);
                } else {
                    cVar.s(18, liveFavorite.getEpgUrl());
                }
                if (liveFavorite.getCategoryProperty() == null) {
                    cVar.d(19);
                } else {
                    cVar.s(19, liveFavorite.getCategoryProperty());
                }
                if (liveFavorite.getId() != null) {
                    cVar.a(20, liveFavorite.getId().intValue());
                } else {
                    cVar.d(20);
                }
                break;
        }
    }

    public final void b(k3.c cVar, LiveHistory liveHistory) {
        switch (this.f33987a) {
            case 0:
                if (liveHistory.getId() != null) {
                    cVar.a(1, liveHistory.getId().intValue());
                } else {
                    cVar.d(1);
                }
                break;
            default:
                if (liveHistory.getId() == null) {
                    cVar.d(1);
                } else {
                    cVar.a(1, liveHistory.getId().intValue());
                }
                if (liveHistory.getChannelId() == null) {
                    cVar.d(2);
                } else {
                    cVar.a(2, liveHistory.getChannelId().intValue());
                }
                if (liveHistory.getTvgName() == null) {
                    cVar.d(3);
                } else {
                    cVar.s(3, liveHistory.getTvgName());
                }
                if (liveHistory.getTvgLogo() == null) {
                    cVar.d(4);
                } else {
                    cVar.s(4, liveHistory.getTvgLogo());
                }
                if (liveHistory.getGroupId() == null) {
                    cVar.d(5);
                } else {
                    cVar.a(5, liveHistory.getGroupId().intValue());
                }
                if (liveHistory.getGroupTitle() == null) {
                    cVar.d(6);
                } else {
                    cVar.s(6, liveHistory.getGroupTitle());
                }
                if (liveHistory.getExtra() == null) {
                    cVar.d(7);
                } else {
                    cVar.s(7, liveHistory.getExtra());
                }
                if (liveHistory.getRegion() == null) {
                    cVar.d(8);
                } else {
                    cVar.s(8, liveHistory.getRegion());
                }
                if (liveHistory.getUrl() == null) {
                    cVar.d(9);
                } else {
                    cVar.s(9, liveHistory.getUrl());
                }
                if (liveHistory.getUpdatedAt() == null) {
                    cVar.d(10);
                } else {
                    cVar.a(10, liveHistory.getUpdatedAt().intValue());
                }
                if (liveHistory.getRoleId() == null) {
                    cVar.d(11);
                } else {
                    cVar.s(11, liveHistory.getRoleId());
                }
                if (liveHistory.getUpdateDate() == null) {
                    cVar.d(12);
                } else {
                    cVar.s(12, liveHistory.getUpdateDate());
                }
                if (liveHistory.getIsPremium() == null) {
                    cVar.d(13);
                } else {
                    cVar.a(13, liveHistory.getIsPremium().intValue());
                }
                if (liveHistory.getProtocol() == null) {
                    cVar.d(14);
                } else {
                    cVar.a(14, liveHistory.getProtocol().intValue());
                }
                if (liveHistory.getIsIptv() == null) {
                    cVar.d(15);
                } else {
                    cVar.a(15, liveHistory.getIsIptv().intValue());
                }
                if (liveHistory.getContentRating() == null) {
                    cVar.d(16);
                } else {
                    cVar.s(16, liveHistory.getContentRating());
                }
                if (liveHistory.getBackupTurboUrl() == null) {
                    cVar.d(17);
                } else {
                    cVar.s(17, liveHistory.getBackupTurboUrl());
                }
                if (liveHistory.getEpgUrl() == null) {
                    cVar.d(18);
                } else {
                    cVar.s(18, liveHistory.getEpgUrl());
                }
                if (liveHistory.getCategoryProperty() == null) {
                    cVar.d(19);
                } else {
                    cVar.s(19, liveHistory.getCategoryProperty());
                }
                if (liveHistory.getId() != null) {
                    cVar.a(20, liveHistory.getId().intValue());
                } else {
                    cVar.d(20);
                }
                break;
        }
    }

    @Override // androidx.room.g
    public final /* bridge */ /* synthetic */ void bind(k3.c cVar, Object obj) {
        switch (this.f33987a) {
            case 0:
                b(cVar, (LiveHistory) obj);
                break;
            case 1:
                a(cVar, (LiveFavorite) obj);
                break;
            case 2:
                b(cVar, (LiveHistory) obj);
                break;
            default:
                a(cVar, (LiveFavorite) obj);
                break;
        }
    }

    @Override // androidx.room.g
    public final String createQuery() {
        switch (this.f33987a) {
            case 0:
                return "DELETE FROM `live_history` WHERE `id` = ?";
            case 1:
                return "DELETE FROM `live_favorite` WHERE `id` = ?";
            case 2:
                return "UPDATE OR REPLACE `live_history` SET `id` = ?,`channel_id` = ?,`tvg_name` = ?,`tvg_logo` = ?,`group_id` = ?,`group_title` = ?,`extra` = ?,`region` = ?,`url` = ?,`updated_at` = ?,`role_id` = ?,`update_date` = ?,`is_premium` = ?,`protocol` = ?,`is_iptv` = ?,`content_rating` = ?,`backup_turbo_url` = ?,`epg_url` = ?,`category_property` = ? WHERE `id` = ?";
            default:
                return "UPDATE OR REPLACE `live_favorite` SET `id` = ?,`channel_id` = ?,`tvg_name` = ?,`tvg_logo` = ?,`group_id` = ?,`group_title` = ?,`extra` = ?,`region` = ?,`url` = ?,`updated_at` = ?,`role_id` = ?,`update_date` = ?,`is_premium` = ?,`is_iptv` = ?,`protocol` = ?,`content_rating` = ?,`backup_turbo_url` = ?,`epg_url` = ?,`category_property` = ? WHERE `id` = ?";
        }
    }
}
