<commit_before>MUSIC_HOST='http://music'

alias play='music_control play'
alias pause='music_control pause'
alias skip='music_control next'
alias playing=music_status
alias music="open $MUSIC_HOST"

# usage: 'music_control play', music_control pause'
function music_control() {
  curl -sI "$MUSIC_HOST/command/?cmd=$1" | head -n 1
  music_status
}

function music_status() {
  curl -s $MUSIC_HOST/_player_engine.php | jq '. | {state, bitrate, fileext, currentsong, currentalbum, currentartist}'
}

# usage 'radio', 'radio 4'. Defaults to 6 music
function radio() {
  music_control "random 0"
  station=${1:-6}
  if [ $station -eq 6 ]; then
    playlist="BBC $station Music"
  else
    playlist="BBC Radio $station"
  fi
  curl -X POST -d "path=BBCRADIO/$playlist.m3u" "$MUSIC_HOST/db/?cmd=addplay"
}<commit_msg>Clear playlist when adding radio, sometimes playlist is max size<commit_after>MUSIC_HOST='http://music'

alias play='music_control play'
alias pause='music_control pause'
alias skip='music_control next'
alias playing=music_status
alias music="open $MUSIC_HOST"

# usage: 'music_control play', music_control pause'
function music_control() {
  curl -sI "$MUSIC_HOST/command/?cmd=$1" | head -n 1
  music_status
}

function music_status() {
  curl -s $MUSIC_HOST/_player_engine.php | jq '. | {state, bitrate, fileext, currentsong, currentalbum, currentartist}'
}

# usage 'radio', 'radio 4'. Defaults to 6 music
function radio() {
  music_control "random 0"
  station=${1:-6}
  if [ $station -eq 6 ]; then
    playlist="BBC $station Music"
  else
    playlist="BBC Radio $station"
  fi
  curl -X POST -d "path=BBCRADIO/$playlist.m3u" "$MUSIC_HOST/db/?cmd=addreplaceplay"
}
{'fraction_non_alphanumeric': 0.13273809523809524, 'fraction_numerical': 0.010714285714285714, 'mean_word_length': 4.960992907801418, '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': '1259198', 'n_tokens_mistral': 618, 'n_tokens_neox': 580, 'n_words': 157}