<commit_before>class Intercode::Import::Intercode1::Tables::Events < Intercode::Import::Intercode1::Table
  INTERCON_Q_PRECON_PREFIXES = %w[DISCUSSION PANEL RANT WORKSHOP PRESENTATION MEETUP]

  def initialize(connection, con)
    super connection
    @con = con
    @markdownifier = Intercode::Import::Intercode1::Markdownifier.new(logger)
    @registration_policy_factory = Intercode::Import::Intercode1::RegistrationPolicyFactory.new
  end

  def dataset
    super.left_outer_join(:Bids, EventId: :EventId).select_all(:Events)
      .select_append(:Status)
      .where(Status: %w[Accepted Dropped]).or(SpecialEvent: 1)
  end

  private

  def build_record(row)
    category = event_category(row)

    @con.events.new(
      title: event_title(row),
      author: row[:Author],
      email: row[:GameEMail],
      organization: row[:Organization],
      url: row[:Homepage],
      length_seconds: row[:Hours] * 1.hour,
      can_play_concurrently: row[:CanPlayConcurrently] == 'Y',
      con_mail_destination: con_mail_destination(row),
      description: @markdownifier.markdownify(row[:Description]),
      short_blurb: @markdownifier.markdownify(row[:ShortBlurb]),
      participant_communications: @markdownifier.markdownify(row[:PlayerCommunications]),
      category: category,
      status: event_status(row),
      registration_policy: registration_policy(row, category),
      bypass_filler_event_run_check: true # we won't yet have the run for filler events

      # notify_on_changes: this doesn't seem to be used anymore<commit_msg>Man this code is old<commit_after>class Intercode::Import::Intercode1::Tables::Events < Intercode::Import::Intercode1::Table
  INTERCON_Q_PRECON_PREFIXES = %w[DISCUSSION PANEL RANT WORKSHOP PRESENTATION MEETUP]

  def initialize(connection, con)
    super connection
    @con = con
    @markdownifier = Intercode::Import::Intercode1::Markdownifier.new(logger)
    @registration_policy_factory = Intercode::Import::Intercode1::RegistrationPolicyFactory.new
  end

  def dataset
    super.left_outer_join(:Bids, EventId: :EventId).select_all(:Events)
      .select_append(:Status)
      .where(Status: %w[Accepted Dropped]).or(SpecialEvent: 1)
  end

  private

  def build_record(row)
    category = event_category(row)

    @con.events.new(
      title: event_title(row),
      author: row[:Author],
      email: row[:GameEMail],
      organization: row[:Organization],
      url: row[:Homepage],
      length_seconds: row[:Hours] * 1.hour,
      can_play_concurrently: row[:CanPlayConcurrently] == 'Y',
      con_mail_destination: con_mail_destination(row),
      description: @markdownifier.markdownify(row[:Description]),
      short_blurb: @markdownifier.markdownify(row[:ShortBlurb]),
      participant_communications: @markdownifier.markdownify(row[:PlayerCommunications]),
      category: category,
      status: event_status(row),
      registration_policy: registration_policy(row, category),
      bypass_single_event_run_check: true # we won't yet have the run for filler events

      # notify_on_changes: this doesn't seem to be used anymore
{'fraction_non_alphanumeric': 0.10964205095130602, 'fraction_numerical': 0.003869719445340213, 'mean_word_length': 4.755102040816326, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4884998', 'n_tokens_mistral': 964, 'n_tokens_neox': 907, 'n_words': 181}