<commit_before>'use strict';

function linein(player, values) {
  const sourcePlayerName = values[0];
  let lineinSourcePlayer = player;

  if (sourcePlayerName) {
    lineinSourcePlayer = player.system.getPlayer(decodeURIComponent(sourcePlayerName));
  }

  if (!lineinSourcePlayer) {
    return Promise.reject(new Error(`Could not find player ${sourcePlayerName}`));
  }

  const uri = `x-rincon-stream:${lineinSourcePlayer.uuid}`;

  return player.coordinator.setAVTransport(uri);
}

module.exports = function (api) {
  api.registerAction('linein', linein);
}<commit_msg>Auto invoke Play when setting line-in<commit_after>'use strict';

function linein(player, values) {
  const sourcePlayerName = values[0];
  let lineinSourcePlayer = player;

  if (sourcePlayerName) {
    lineinSourcePlayer = player.system.getPlayer(decodeURIComponent(sourcePlayerName));
  }

  if (!lineinSourcePlayer) {
    return Promise.reject(new Error(`Could not find player ${sourcePlayerName}`));
  }

  const uri = `x-rincon-stream:${lineinSourcePlayer.uuid}`;

  return player.coordinator.setAVTransport(uri)
    .then(() => player.coordinator.play());
}

module.exports = function (api) {
  api.registerAction('linein', linein);
}
{'fraction_non_alphanumeric': 0.13168724279835392, 'fraction_numerical': 0.0016460905349794238, 'mean_word_length': 5.300518134715026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1266729', 'n_tokens_mistral': 377, 'n_tokens_neox': 375, 'n_words': 75}