mirror of
				https://github.com/PhoenixTwoFive/karaoqueue.git
				synced 2025-11-04 09:25:11 +01:00 
			
		
		
		
	Add constructors and accessors to models
This commit is contained in:
		@@ -1,4 +1,10 @@
 | 
				
			|||||||
export class Artist {
 | 
					export class Artist {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  constructor(id: number, name: string) {
 | 
				
			||||||
 | 
					    this.id = id;
 | 
				
			||||||
 | 
					    this.name = name;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  id: number;
 | 
					  id: number;
 | 
				
			||||||
  name: string;
 | 
					  name: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,16 @@
 | 
				
			|||||||
export class Genre {
 | 
					export class Genre {
 | 
				
			||||||
  id: number;
 | 
					
 | 
				
			||||||
  name: string;
 | 
					  constructor(id: number, name: string) {
 | 
				
			||||||
 | 
					    this.id = id;
 | 
				
			||||||
 | 
					    this._name = name;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  public get name() : string {
 | 
				
			||||||
 | 
					    return this._name;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  id: number;
 | 
				
			||||||
 | 
					  _name: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,10 @@
 | 
				
			|||||||
export class Language {
 | 
					export class Language {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  constructor(id: number, name: string) {
 | 
				
			||||||
 | 
					    this.id = id;
 | 
				
			||||||
 | 
					    this.name = name;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  id: number;
 | 
					  id: number;
 | 
				
			||||||
  name: string;
 | 
					  name: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,12 +3,24 @@ import { Language } from './language.model';
 | 
				
			|||||||
import { Artist } from './artist.model';
 | 
					import { Artist } from './artist.model';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Song {
 | 
					export class Song {
 | 
				
			||||||
  explicit: boolean;
 | 
					
 | 
				
			||||||
  duet: boolean;
 | 
					  constructor(title: string, artist: Artist, karafun_id: number, duet: boolean, explicit: boolean, id: number, genres: Array<Genre>, languages: Array<Language>) {
 | 
				
			||||||
 | 
					    this.title=title;
 | 
				
			||||||
 | 
					    this.artist=artist;
 | 
				
			||||||
 | 
					    this.karafun_id=karafun_id;
 | 
				
			||||||
 | 
					    this.duet=duet;
 | 
				
			||||||
 | 
					    this.explicit=explicit;
 | 
				
			||||||
 | 
					    this.id=id;
 | 
				
			||||||
 | 
					    this.genres=genres;
 | 
				
			||||||
 | 
					    this.languages=languages;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  title: string;
 | 
					  title: string;
 | 
				
			||||||
  id: number;
 | 
					  artist: Artist;
 | 
				
			||||||
  karafun_id: number;
 | 
					  karafun_id: number;
 | 
				
			||||||
 | 
					  duet: boolean;
 | 
				
			||||||
 | 
					  explicit: boolean;
 | 
				
			||||||
 | 
					  id: number;
 | 
				
			||||||
  genres: Array<Genre>;
 | 
					  genres: Array<Genre>;
 | 
				
			||||||
  languages: Array<Language>;
 | 
					  languages: Array<Language>;
 | 
				
			||||||
  artist: Artist;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user