Restored and updated api toggle

The settings screen where you can toggle each API per media type is now fully automatic and works for each media type that has more than 1 API.
This commit is contained in:
ltctceplrm 2025-03-04 23:01:44 +01:00
parent d54822444a
commit 4de707f29e
2 changed files with 540 additions and 559 deletions

View file

@ -19,13 +19,13 @@ export abstract class APIModel {
abstract getById(id: string): Promise<MediaTypeModel>;
hasType(type: MediaType): boolean {
// if (
// this.types.contains(type) &&
// (Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type]) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] === undefined)
// ) {
// return true;
// }
return this.types.contains(type);
if (
this.types.contains(type) &&
(Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type]) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] === undefined)
) {
return true;
}
return false;
}
hasTypeOverlap(types: MediaType[]): boolean {

File diff suppressed because it is too large Load diff