<commit_before>import { Injectable } from '@angular/core';
import { Http, Response, Headers } from '@angular/http';
import { UserService } from 'sarlacc-angular-client';

import { Globals } from '../globals';

import { Song } from './song';

@Injectable()
export class SongService {

  constructor(
    private http: Http,
    private userSvc: UserService
  ){}

  globals: Globals = new Globals();

  private songUrl = this.globals.svc_domain + '/songs/';

  getSongs(): Promise<Song[]> {
    return this.http.get(this.songUrl)
    .toPromise()
    .then((res:any) => {
      return res.json();
    }).catch((err:any) => {
      console.log(err);
    });
  }

  getSongById(songId:string): Promise<Song> {
    return this.http.get(this.songUrl + songId)
    .toPromise()
    .then((res:any) => {
      return res.json();
    }).catch((err:any) => {
      console.log(err);
    });
  } 

  createSong(songFile:File,songToCreate:Song): Promise<Song> {

    let formData:FormData = new FormData();
    formData.append('name', songToCreate.name);
    formData.append('filename', songToCreate.filename);
    formData.append('song', songFile);

    let headers = this.userSvc.getAuthHeaders();
    headers.append('Content-Type','multipart/form-data');

    return this.http.post(this.songUrl, formData, headers)
    .toPromise()
    .then((res:any) => {
      return res.json();
    }).catch((err:any) => {
      console.log(err);
    });
  }

  deleteSong(songId:string): Promise<void> {
    return this.http.delete(this.songUrl + songId, {headers: this.userSvc.getAuthHeaders()})
    .toPromise()
    .then((res:any) => {
    }).catch((err:any) => {
      console.log(err);
    });
  }


}<commit_msg>fixed call to create song<commit_after>import { Injectable } from '@angular/core';
import { Http, Response, Headers } from '@angular/http';
import { UserService } from 'sarlacc-angular-client';

import { Globals } from '../globals';

import { Song } from './song';

@Injectable()
export class SongService {

  constructor(
    private http: Http,
    private userSvc: UserService
  ){}

  globals: Globals = new Globals();

  private songUrl = this.globals.svc_domain + '/songs/';

  getSongs(): Promise<Song[]> {
    return this.http.get(this.songUrl)
    .toPromise()
    .then((res:any) => {
      return res.json();
    }).catch((err:any) => {
      console.log(err);
    });
  }

  getSongById(songId:string): Promise<Song> {
    return this.http.get(this.songUrl + songId)
    .toPromise()
    .then((res:any) => {
      return res.json();
    }).catch((err:any) => {
      console.log(err);
    });
  } 

  createSong(songFile:File,songToCreate:Song): Promise<Song> {

    let formData:FormData = new FormData();
    formData.append('name', songToCreate.name);
    formData.append('filename', songToCreate.filename);
    formData.append('song', songFile);

    let headers = this.userSvc.getAuthHeaders();
    headers.delete('Content-Type');

    return this.http.post(this.songUrl, formData, {headers: headers})
    .toPromise()
    .then((res:any) => {
      return res.json();
    }).catch((err:any) => {
      console.log(err);
    });
  }

  deleteSong(songId:string): Promise<void> {
    return this.http.delete(this.songUrl + songId, {headers: this.userSvc.getAuthHeaders()})
    .toPromise()
    .then((res:any) => {
    }).catch((err:any) => {
      console.log(err);
    });
  }


}
{'fraction_non_alphanumeric': 0.17839269944068295, 'fraction_numerical': 0.0, 'mean_word_length': 3.2581453634085213, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, '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': '204291', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1139, 'n_words': 203}