<commit_before>module Play
  class MpcClient < Client
    # Have the client play a song
    #
    # Returns nothing
    def self.play(song_path)
      if `mpc playlist | wc -l`.to_i < 1
        system('mpc', 'add', song_path.gsub(/^#{Play.config['path']}\//,""))
      end
      `mpc play`
      `mpc idle` # self.play is expected to block, so wait for an event
    end

    # Cause the client to play the next song.
    #
    # Returns true if successful, else false.
    def self.next
      `mpc next`
    end
<commit_msg>Don't block Client playing loop if MpcClient can't add the song.<commit_after>module Play
  class MpcClient < Client
    # Have the client play a song
    #
    # Returns nothing
    def self.play(song_path)
      if `mpc playlist | wc -l`.to_i < 1
        if not system('mpc', 'add',
          song_path.gsub(/^#{Play.config['path']}\//,""))
          return # mpc didn't add the song, so just return, don't block
      end
      `mpc play`
      `mpc idle` # self.play is expected to block, so wait for an event
    end

    # Cause the client to play the next song.
    #
    # Returns true if successful, else false.
    def self.next
      `mpc next`
    end

{'fraction_non_alphanumeric': 0.10606060606060606, 'fraction_numerical': 0.0016835016835016834, 'mean_word_length': 2.196236559139785, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7352385', 'n_tokens_mistral': 392, 'n_tokens_neox': 381, 'n_words': 141}