Add BoardGameGeekAPI

This commit is contained in:
Cedric Finance 2022-08-17 23:05:49 +02:00
parent e4788750f7
commit 47d59278a6
No known key found for this signature in database
7 changed files with 196 additions and 1 deletions

View 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;
}
}