maintenance
This commit is contained in:
parent
846f7de184
commit
1d76bb8981
7 changed files with 80 additions and 55 deletions
|
|
@ -8,6 +8,12 @@ export class APIManager {
|
|||
this.apis = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries the basic info for one query string and multiple APIs.
|
||||
*
|
||||
* @param query
|
||||
* @param apisToQuery
|
||||
*/
|
||||
async query(query: string, apisToQuery: string[]): Promise<MediaTypeModel[]> {
|
||||
console.debug(`MDB | api manager queried with "${query}"`);
|
||||
|
||||
|
|
@ -23,10 +29,21 @@ export class APIManager {
|
|||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries detailed information for a MediaTypeModel.
|
||||
*
|
||||
* @param item
|
||||
*/
|
||||
async queryDetailedInfo(item: MediaTypeModel): Promise<MediaTypeModel> {
|
||||
return await this.queryDetailedInfoById(item.id, item.dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries detailed info for an id from an API.
|
||||
*
|
||||
* @param id
|
||||
* @param apiName
|
||||
*/
|
||||
async queryDetailedInfoById(id: string, apiName: string): Promise<MediaTypeModel> {
|
||||
for (const api of this.apis) {
|
||||
if (api.apiName === apiName) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue