<commit_before>"use strict";

const TsChar = require("./char");
const TsDate = require("./date");
const epgTable = require("./epg_table");

class TsEpg {
    constructor() {
        this.epg = {};
    }

    needUpdate(current, next) {
        if (current === null) return true;

        if (current.table_id === 0x4E || current.table_id === 0x4F) {
            if (next.table_id !== 0x4E && next.table_id !== 0x4F) {
                return false;
            }
        }

        if (current.version_number === next.version_number) {
            return false;
        }

        return false;
    }

    addEit(pid, objEit) {
        if (pid !== 0x12) return true;
        if (objEit.events.length === 0) return true;

        let onid = objEit.original_network_id;
        let tsid = objEit.transport_stream_id;
        let sid = objEit.service_id;

        if (!this.epg.hasOwnProperty(onid)) {
            this.epg[onid] = {};
        }

        if (!this.epg[onid].hasOwnProperty(tsid)) {
            this.epg[onid][tsid] = {};
        }

        if (!this.epg[onid][tsid].hasOwnProperty(sid)) {<commit_msg>Fix epg.js<commit_after>"use strict";

const TsChar = require("./char");
const TsDate = require("./date");
const epgTable = require("./epg_table");

class TsEpg {
    constructor() {
        this.epg = {};
    }

    needUpdate(current, next) {
        if (current === null) return true;

        if (current.table_id === 0x4E || current.table_id === 0x4F) {
            if (next.table_id !== 0x4E && next.table_id !== 0x4F) {
                return false;
            }
        }

        if (current.version_number === next.version_number) {
            return false;
        }

        return true;
    }

    addEit(pid, objEit) {
        if (pid !== 0x12) return true;
        if (objEit.events.length === 0) return true;

        let onid = objEit.original_network_id;
        let tsid = objEit.transport_stream_id;
        let sid = objEit.service_id;

        if (!this.epg.hasOwnProperty(onid)) {
            this.epg[onid] = {};
        }

        if (!this.epg[onid].hasOwnProperty(tsid)) {
            this.epg[onid][tsid] = {};
        }

        if (!this.epg[onid][tsid].hasOwnProperty(sid)) {
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.010810810810810811, 'mean_word_length': 1.9339498018494055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2033840', 'n_tokens_mistral': 769, 'n_tokens_neox': 740, 'n_words': 141}