Fixed the WIP sub object code

This commit is contained in:
ltctceplrm 2024-03-24 17:44:10 +01:00
parent 139cf8388c
commit 9bc3bea90d
2 changed files with 48 additions and 44 deletions

View file

@ -20,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}`)) as keyof MediaDbPluginSettings] === false)) {
if (this.types.contains(type) && (Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] as MediaDbPluginSettings) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] as MediaDbPluginSettings === undefined)) {
return true;
}
}