Fixed advanced search by adding a default media type for certain APIs
This commit is contained in:
parent
d1affcdcb6
commit
508b0ed03b
2 changed files with 24 additions and 12 deletions
|
|
@ -87,6 +87,7 @@ export class MediaDbAdvancedSearchModal extends Modal {
|
|||
|
||||
// const apiToggleComponents: Component[] = [];
|
||||
for (const api of this.plugin.apiManager.apis) {
|
||||
if (this.plugin.settings[[api.apiName, "default"].filter(s => s).join('') as keyof typeof this.plugin.settings] || this.plugin.settings[[api.apiName, "game"].filter(s => s).join('') as keyof typeof this.plugin.settings] || this.plugin.settings[[api.apiName, "series"].filter(s => s).join('') as keyof typeof this.plugin.settings] || this.plugin.settings[[api.apiName, "movie"].filter(s => s).join('') as keyof typeof this.plugin.settings]) {
|
||||
const apiToggleListElementWrapper = contentEl.createEl('div', { cls: 'media-db-plugin-list-wrapper' });
|
||||
|
||||
const apiToggleTextWrapper = apiToggleListElementWrapper.createEl('div', { cls: 'media-db-plugin-list-text-wrapper' });
|
||||
|
|
@ -103,6 +104,7 @@ export class MediaDbAdvancedSearchModal extends Modal {
|
|||
});
|
||||
apiToggleComponentWrapper.appendChild(apiToggleComponent.toggleEl);
|
||||
}
|
||||
}
|
||||
|
||||
contentEl.createDiv({ cls: 'media-db-plugin-spacer' });
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ export interface MediaDbPluginSettings {
|
|||
MALAPIseries: boolean;
|
||||
SteamAPIgame: boolean;
|
||||
MobyGamesAPIgame: boolean;
|
||||
BoardGameGeekAPIdefault: boolean;
|
||||
MALAPIMangadefault: boolean;
|
||||
MusicBrainzAPIdefault: boolean;
|
||||
OpenLibraryAPIdefault: boolean;
|
||||
WikipediaAPIdefault: boolean;
|
||||
|
||||
movieTemplate: string;
|
||||
seriesTemplate: string;
|
||||
|
|
@ -83,6 +88,11 @@ const DEFAULT_SETTINGS: MediaDbPluginSettings = {
|
|||
MALAPImovie: true,
|
||||
SteamAPIgame: true,
|
||||
MobyGamesAPIgame: true,
|
||||
BoardGameGeekAPIdefault: true,
|
||||
MALAPIMangadefault: true,
|
||||
MusicBrainzAPIdefault: true,
|
||||
OpenLibraryAPIdefault: true,
|
||||
WikipediaAPIdefault: true,
|
||||
|
||||
movieTemplate: '',
|
||||
seriesTemplate: '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue