<commit_before>$(document).ready(function(){
    $('#searchbox').focus();
});
$.getJSON('/config.json',function(config){
  $("#searchbox").bind('keydown',function(e){
    if(e.keyCode===13){
      var text=this.value;
      if(text.substr(0,4)==="http"){
        //We have a youtube link for us
        $.post('/youtube',{link:text});
      }
      else{
        $.get(config.muzi_root+"ajax/search/",{search:text},function(data){
          console.log(data);
          console.log(config);
          $('#artists').remove();
          $('#tracks').remove();
          $('#albums').remove();
          $('.data').append('<div id="tracks" class="span4"><h2>Tracks</h2><ol></ol></div>');
          $('.data').append('<div id="artists" class="span4"><h2>Artists</h2><ol></ol></div>');
          $('.data').append('<div id="albums" class="span4"><h2>Albums</h2><ol></ol></div>');
          
          html='';
          for(i in data.tracks){
            html+='<li mid="'+data.tracks[i].id
              +'"><img style="float:left" class="thumbnail" width="50" height="50" src="'
              +config.pics_root
              +data.tracks[i].albumId
              +'.jpg"><div class="entry1">'
              +data.tracks[i].title
              +'</div><div class="entry2">'
              +data.tracks[i].artist
              +'</div><div style="clear:both">'
              +'</div></li>'
          }
          $('#tracks ol').html(html);

          html='';
          for(i in data.artists){
            html+='<li mt="artist" mid="'
            +data.artists[i].id+
            '"><img style="float:left" class="thumbnail" width="50" height="50" src="'
            +config.artist_pics_root
            +data.artists[i].id
            +'.jpg"><div class="entry1">'
            +data.artists[i].name
            +'</div><div style="clear:both"></div></li>'
          }
          $('#artists ol').html(html);
          https://sdslabs.co.in/muzi/artist_pics/17.jpg

          html='';
          for(i in data.albums){
            html+='<li mt="album" mid="'
            +data.albums[i].id
            +'"><img style="float:left" class="thumbnail" width="50" height="50" src="'
            +config.pics_root
            +data.albums[i].id
            +'.jpg"><div class="entry1">'
            +data.albums[i].name
            +'</div><div class="entry2">'
            +data.albums[i].band
            +'</div><div style="clear:both">'
            +'</div></li>'

          }
          $('#albums ol').html(html);
        });
      }
    }
  });

  $('.stop').click(function(){
    $.get("/kill");
  });
  
  $('.data').delegate('#tracks ol li','click',function(e){
    console.log('We clicked on a song!');
    var trackId=this.getAttribute('mid')
    $.get(config.muzi_root+"ajax/track/",{id:trackId},function(data){
      var url=data.file.split('/').map(function(x){return encodeURIComponent(x);}).join('/');
      $.post('/play',{url:config.music_root+url,id:data.id},function(){
        console.log("Sent a play request");
      })
    })
  });  
  
  $('.data').delegate('#artists ol li','click',function(e){
    //We clicked on an artist!
    //console.log('We clicked on an artist!');

    var artistId=this.getAttribute('mid');
    $.get(config.muzi_root+"ajax/band/albums.php",{id:artistId},function(data){
      $('#artists').remove();
      $('#tracks').remove();
      $('#albums').removeClass().addClass('span4 offset4');
      html='';
      for(i in data.albums){
        html+='<li mt="album" mid="'
        +data.albums[i].id
        +'"><img style="float:left" class="thumbnail" width="50" height="50" src="'
        +config.pics_root
        +data.albums[i].id<commit_msg>Make an anonymous log on muzi on playing songs<commit_after>$(document).ready(function(){
    $('#searchbox').focus();
});
$.getJSON('/config.json',function(config){
  $("#searchbox").bind('keydown',function(e){
    if(e.keyCode===13){
      var text=this.value;
      if(text.substr(0,4)==="http"){
        //We have a youtube link for us
        $.post('/youtube',{link:text});
      }
      else{
        $.get(config.muzi_root+"ajax/search/",{search:text},function(data){
          console.log(data);
          console.log(config);
          $('#artists').remove();
          $('#tracks').remove();
          $('#albums').remove();
          $('.data').append('<div id="tracks" class="span4"><h2>Tracks</h2><ol></ol></div>');
          $('.data').append('<div id="artists" class="span4"><h2>Artists</h2><ol></ol></div>');
          $('.data').append('<div id="albums" class="span4"><h2>Albums</h2><ol></ol></div>');
          
          html='';
          for(i in data.tracks){
            html+='<li mid="'+data.tracks[i].id
              +'"><img style="float:left" class="thumbnail" width="50" height="50" src="'
              +config.pics_root
              +data.tracks[i].albumId
              +'.jpg"><div class="entry1">'
              +data.tracks[i].title
              +'</div><div class="entry2">'
              +data.tracks[i].artist
              +'</div><div style="clear:both">'
              +'</div></li>'
          }
          $('#tracks ol').html(html);

          html='';
          for(i in data.artists){
            html+='<li mt="artist" mid="'
            +data.artists[i].id+
            '"><img style="float:left" class="thumbnail" width="50" height="50" src="'
            +config.artist_pics_root
            +data.artists[i].id
            +'.jpg"><div class="entry1">'
            +data.artists[i].name
            +'</div><div style="clear:both"></div></li>'
          }
          $('#artists ol').html(html);
          https://sdslabs.co.in/muzi/artist_pics/17.jpg

          html='';
          for(i in data.albums){
            html+='<li mt="album" mid="'
            +data.albums[i].id
            +'"><img style="float:left" class="thumbnail" width="50" height="50" src="'
            +config.pics_root
            +data.albums[i].id
            +'.jpg"><div class="entry1">'
            +data.albums[i].name
            +'</div><div class="entry2">'
            +data.albums[i].band
            +'</div><div style="clear:both">'
            +'</div></li>'

          }
          $('#albums ol').html(html);
        });
      }
    }
  });

  $('.stop').click(function(){
    $.get("/kill");
  });
  
  $('.data').delegate('#tracks ol li','click',function(e){
    console.log('We clicked on a song!');
    var trackId=this.getAttribute('mid')
    $.get(config.muzi_root+"ajax/track/",{id:trackId},function(data){
      var url=data.file.split('/').map(function(x){return encodeURIComponent(x);}).join('/');
      $.post('/play',{url:config.music_root+url,id:data.id},function(){
        console.log("Sent a play request");
        $.get(config.muzi_root+'ajax/track/log.php',{id:data.id});
      })
    })
  });  
  
  $('.data').delegate('#artists ol li','click',function(e){
    //We clicked on an artist!
    //console.log('We clicked on an artist!');

    var artistId=this.getAttribute('mid');
    $.get(config.muzi_root+"ajax/band/albums.php",{id:artistId},function(data){
      $('#artists').remove();
      $('#tracks').remove();
      $('#albums').removeClass().addClass('span4 offset4');
      html='';
      for(i in data.albums){
        html+='<li mt="album" mid="'
        +data.albums[i].id
        +'"><img style="float:left" class="thumbnail" width="50" height="50" src="'
        +config.pics_root
        +data.albums[i].id
{'fraction_non_alphanumeric': 0.2295235546038544, 'fraction_numerical': 0.010171306209850108, 'mean_word_length': 2.2633187772925765, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 91, 'https://': 2, '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': '1729740', 'n_tokens_mistral': 2478, 'n_tokens_neox': 2438, 'n_words': 338}