diff --git a/src/api/APIModel.ts b/src/api/APIModel.ts index 94adbd3..6056a7d 100644 --- a/src/api/APIModel.ts +++ b/src/api/APIModel.ts @@ -19,8 +19,9 @@ export abstract class APIModel { abstract getById(id: string): Promise; hasType(type: MediaType): boolean { - const disabledMediaTypes = this.plugin.settings[`${this.apiName}_disabledMediaTypes` as keyof typeof this.plugin.settings] as MediaType[]; - return this.types.includes(type) && !disabledMediaTypes.includes(type); + const sanitizedApiName = this.apiName.replace(/\s+/g, '_'); + const disabledMediaTypes = (this.plugin.settings[`${sanitizedApiName}_disabledMediaTypes` as keyof typeof this.plugin.settings] as MediaType[]) || []; + return (this.types || []).includes(type) && !disabledMediaTypes.includes(type); } hasTypeOverlap(types: MediaType[]): boolean {