Add BoardGameGeekAPI
This commit is contained in:
parent
e4788750f7
commit
47d59278a6
7 changed files with 196 additions and 1 deletions
43
src/models/BoardGameModel.ts
Normal file
43
src/models/BoardGameModel.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import {MediaTypeModel} from './MediaTypeModel';
|
||||
import {mediaDbTag} from '../utils/Utils';
|
||||
import {MediaType} from '../utils/MediaType';
|
||||
|
||||
|
||||
export class BoardGameModel extends MediaTypeModel {
|
||||
type: string;
|
||||
title: string;
|
||||
englishTitle: string;
|
||||
year: string;
|
||||
dataSource: string;
|
||||
url: string;
|
||||
id: string;
|
||||
|
||||
genres: string[];
|
||||
onlineRating: number;
|
||||
image: string;
|
||||
|
||||
released: boolean;
|
||||
|
||||
userData: {
|
||||
played: boolean;
|
||||
personalRating: number;
|
||||
};
|
||||
|
||||
|
||||
constructor(obj: any = {}) {
|
||||
super();
|
||||
|
||||
Object.assign(this, obj);
|
||||
|
||||
this.type = this.getMediaType();
|
||||
}
|
||||
|
||||
getTags(): string[] {
|
||||
return [mediaDbTag, 'boardgame'];
|
||||
}
|
||||
|
||||
getMediaType(): MediaType {
|
||||
return MediaType.BoardGame;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue