Added a fix for api's with spaces in their names
This commit is contained in:
parent
e09737a090
commit
98e96b15c7
1 changed files with 3 additions and 2 deletions
|
|
@ -19,8 +19,9 @@ export abstract class APIModel {
|
|||
abstract getById(id: string): Promise<MediaTypeModel>;
|
||||
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue