games, english anime titles, specials and OVAs

This commit is contained in:
mProjectsCode 2022-05-12 17:18:12 +02:00
parent c400b7abf5
commit d2afe3bcc2
10 changed files with 141 additions and 42 deletions

View file

@ -1,30 +1,30 @@
import {MediaTypeModel} from '../models/MediaTypeModel';
export abstract class APIModel {
apiName: string;
apiUrl: string;
apiDescription: string;
types: string[];
apiName: string;
apiUrl: string;
apiDescription: string;
types: string[];
/**
* This function should query the api and return a list of matches. The matches should be caped at 20.
*
* @param title the title to query for
*/
abstract searchByTitle(title: string): Promise<MediaTypeModel[]>;
/**
* This function should query the api and return a list of matches. The matches should be caped at 20.
*
* @param title the title to query for
*/
abstract searchByTitle(title: string): Promise<MediaTypeModel[]>;
abstract getById(item: MediaTypeModel): Promise<MediaTypeModel>;
abstract getById(item: MediaTypeModel): Promise<MediaTypeModel>;
hasType(type: string): boolean {
return this.types.contains(type);
}
hasType(type: string): boolean {
return this.types.contains(type);
}
hasTypeOverlap(types: string[]): boolean {
for (const type of types) {
if (this.hasType(type)) {
return true;
}
}
return false;
}
hasTypeOverlap(types: string[]): boolean {
for (const type of types) {
if (this.hasType(type)) {
return true;
}
}
return false;
}
}