<commit_before>const eveonlinejs = Meteor.npmRequire('eveonlinejs');

Meteor.methods({
  'addKeyCharacters': function (charactersObj, keyID, vCode) {
    let runSyncResult = Async.runSync(function (done) {
      for (let charID in charactersObj) {
        Meteor.call('insertCharacter', keyID, vCode, charID);
      }
      Meteor.call('detectPrimaryCharacter', keyID);
      done(null, true);
    });

    if (runSyncResult.error) throw runSyncResult.error;
    else if (runSyncResult.result) return runSyncResult.result;
  },

  'insertCharacter': function (keyID, vCode, charID) {
    let runSyncResult = Async.runSync(function (done) {
      eveonlinejs.fetch('eve:CharacterInfo', {keyID: keyID, vCode: vCode, characterID: charID}, function (err, result) {
        if (err) done(err, null);
        else {
          result.keyID = keyID;
          done(null, result);
        }
      });
    })
    if (runSyncResult.error) throw runSyncResult.error;
    else if (runSyncResult.result) {
      Characters.insert(runSyncResult.result);<commit_msg>Remove vCode argument from insertCharacter method<commit_after>const eveonlinejs = Meteor.npmRequire('eveonlinejs');

Meteor.methods({
  'addKeyCharacters': function (charactersObj, keyID, vCode) {
    let runSyncResult = Async.runSync(function (done) {
      for (let charID in charactersObj) {
        Meteor.call('insertCharacter', keyID, vCode, charID);
      }
      Meteor.call('detectPrimaryCharacter', keyID);
      done(null, true);
    });

    if (runSyncResult.error) throw runSyncResult.error;
    else if (runSyncResult.result) return runSyncResult.result;
  },

  'insertCharacter': function (keyID, charID) {
    const vCode = Keys.findOne({keyID: keyID}).vCode;

    let runSyncResult = Async.runSync(function (done) {
      eveonlinejs.fetch('eve:CharacterInfo', {keyID: keyID, vCode: vCode, characterID: charID}, function (err, result) {
        if (err) done(err, null);
        else {
          result.keyID = keyID;
          done(null, result);
        }
      });
    })
    if (runSyncResult.error) throw runSyncResult.error;
    else if (runSyncResult.result) {
      Characters.insert(runSyncResult.result);
{'fraction_non_alphanumeric': 0.12454212454212454, 'fraction_numerical': 0.0, 'mean_word_length': 3.3963782696177063, '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': '1030396', 'n_tokens_mistral': 693, 'n_tokens_neox': 672, 'n_words': 149}