Ran formatter, removed unused array and updated APIModel.ts

This commit is contained in:
ltctceplrm 2024-03-16 14:18:14 +01:00
parent f52060482a
commit 5eec98d127
8 changed files with 44 additions and 45 deletions

View file

@ -18,7 +18,7 @@ export class APIManager {
console.debug(`MDB | api manager queried with "${query}"`);
let res: MediaTypeModel[] = [];
for (const api of this.apis) {
if (apisToQuery.contains(api.apiName)) {
const apiRes = await api.searchByTitle(query);

View file

@ -1,5 +1,6 @@
import { MediaTypeModel } from '../models/MediaTypeModel';
import { MediaType } from '../utils/MediaType';
import { MediaDbPluginSettings } from 'src/settings/Settings';
import MediaDbPlugin from '../main';
export abstract class APIModel {
@ -19,7 +20,7 @@ export abstract class APIModel {
abstract getById(id: string): Promise<MediaTypeModel>;
hasType(type: MediaType): boolean {
if (this.types.contains(type) && !(this.plugin.settings[[this.apiName, type].filter(s => s).join('') as keyof typeof this.plugin.settings] === false)){
if (this.types.contains(type) && !(this.plugin.settings[(this.apiName + type) as keyof MediaDbPluginSettings] === false)) {
return true;
}
}
@ -32,4 +33,4 @@ export abstract class APIModel {
}
return false;
}
}
}