Skip to content

Commit 4de707f

Browse files
committed
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.
1 parent d548224 commit 4de707f

File tree

2 files changed

+579
-598
lines changed

2 files changed

+579
-598
lines changed

src/api/APIModel.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export abstract class APIModel {
1919
abstract getById(id: string): Promise<MediaTypeModel>;
2020

2121
hasType(type: MediaType): boolean {
22-
// if (
23-
// this.types.contains(type) &&
24-
// (Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type]) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] === undefined)
25-
// ) {
26-
// return true;
27-
// }
28-
return this.types.contains(type);
22+
if (
23+
this.types.contains(type) &&
24+
(Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type]) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] === undefined)
25+
) {
26+
return true;
27+
}
28+
return false;
2929
}
3030

3131
hasTypeOverlap(types: MediaType[]): boolean {

0 commit comments

Comments
 (0)