<commit_before>import { Component, OnInit } from '@angular/core';
import { Album } from '../_models';
import { AlbumService } from '../_services';
import { MdDialog, MdDialogRef } from '@angular/material';
import '../../../node_modules/@swimlane/ngx-datatable/release/index.css';
import '../../../node_modules/@swimlane/ngx-datatable/release/themes/material.css';
import '../../../node_modules/@swimlane/ngx-datatable/release/assets/icons.css';

@Component({
  selector: 'dialog-overview-example-dialog',
  templateUrl: 'updateAlbumDialog.component.html',
  styleUrls: ['./albums.component.css']
})

export class UpdateAlbumDialogComponent {
  currentAlbum: any;
  albumService: AlbumService;
  constructor(public dialogRef: MdDialogRef<UpdateAlbumDialogComponent>) {}

  updateAlbum() {
    this.albumService.update(this.currentAlbum).subscribe(() => this.dialogRef.close());
  }

  deleteAlbum() {
    this.albumService.delete(this.currentAlbum.id).subscribe(() => this.dialogRef.close());
  }
}
<commit_msg>Format album after update<commit_after>import { Component, OnInit } from '@angular/core';
import { Album } from '../_models';
import { AlbumService } from '../_services';
import { MdDialog, MdDialogRef } from '@angular/material';
import '../../../node_modules/@swimlane/ngx-datatable/release/index.css';
import '../../../node_modules/@swimlane/ngx-datatable/release/themes/material.css';
import '../../../node_modules/@swimlane/ngx-datatable/release/assets/icons.css';

@Component({
  selector: 'dialog-overview-example-dialog',
  templateUrl: 'updateAlbumDialog.component.html',
  styleUrls: ['./albums.component.css']
})

export class UpdateAlbumDialogComponent {
  currentAlbum: any;
  albumService: AlbumService;
  constructor(public dialogRef: MdDialogRef<UpdateAlbumDialogComponent>) {}

  private formatCurrentAlbum() : Album {
    return {...this.currentAlbum, 
      genres: this.currentAlbum.genres.split(','),
      artists: this.currentAlbum.artists.map(artist => String(artist.id))
    };
  }

  updateAlbum() {
    this.albumService.update(this.formatCurrentAlbum()).subscribe(() => this.dialogRef.close());
  }

  deleteAlbum() {
    this.albumService.delete(this.currentAlbum.id).subscribe(() => this.dialogRef.close());
  }
}

{'fraction_non_alphanumeric': 0.17310252996005326, 'fraction_numerical': 0.0, 'mean_word_length': 4.579207920792079, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '3727326', 'n_tokens_mistral': 706, 'n_tokens_neox': 672, 'n_words': 107}