@@ -22,17 +22,17 @@ export interface MediaDbPluginSettings {
2222 openNoteInNewTab : boolean ;
2323 useDefaultFrontMatter : boolean ;
2424 enableTemplaterIntegration : boolean ;
25- OMDbAPI_disabledMediaTypes : string [ ] ;
26- MALAPI_disabledMediaTypes : string [ ] ;
27- MALAPIManga_disabledMediaTypes : string [ ] ;
28- ComicVineAPI_disabledMediaTypes : string [ ] ;
29- SteamAPI_disabledMediaTypes : string [ ] ;
30- MobyGamesAPI_disabledMediaTypes : string [ ] ;
31- GiantBombAPI_disabledMediaTypes : string [ ] ;
32- WikipediaAPI_disabledMediaTypes : string [ ] ;
33- BoardgameGeekAPI_disabledMediaTypes : string [ ] ;
34- MusicBrainzAPI_disabledMediaTypes : string [ ] ;
35- OpenLibraryAPI_disabledMediaTypes : string [ ] ;
25+ OMDbAPI_disabledMediaTypes : MediaType [ ] ;
26+ MALAPI_disabledMediaTypes : MediaType [ ] ;
27+ MALAPIManga_disabledMediaTypes : MediaType [ ] ;
28+ ComicVineAPI_disabledMediaTypes : MediaType [ ] ;
29+ SteamAPI_disabledMediaTypes : MediaType [ ] ;
30+ MobyGamesAPI_disabledMediaTypes : MediaType [ ] ;
31+ GiantBombAPI_disabledMediaTypes : MediaType [ ] ;
32+ WikipediaAPI_disabledMediaTypes : MediaType [ ] ;
33+ BoardgameGeekAPI_disabledMediaTypes : MediaType [ ] ;
34+ MusicBrainzAPI_disabledMediaTypes : MediaType [ ] ;
35+ OpenLibraryAPI_disabledMediaTypes : MediaType [ ] ;
3636 movieTemplate : string ;
3737 seriesTemplate : string ;
3838 mangaTemplate : string ;
@@ -299,40 +299,40 @@ export class MediaDbSettingTab extends PluginSettingTab {
299299 } ) ;
300300
301301 // Create a map to store APIs for each media type
302- const mediaTypeApiMap = new Map < string , string [ ] > ( ) ;
302+ const mediaTypeApiMap = new Map < MediaType , string [ ] > ( ) ;
303303
304304 // Populate the map with APIs for each media type dynamically
305305 for ( const api of this . plugin . apiManager . apis ) {
306- for ( const MediaType of api . types ) {
307- if ( ! mediaTypeApiMap . has ( MediaType ) ) {
308- mediaTypeApiMap . set ( MediaType , [ ] ) ;
306+ for ( const mediaType of api . types ) {
307+ if ( ! mediaTypeApiMap . has ( mediaType ) ) {
308+ mediaTypeApiMap . set ( mediaType , [ ] ) ;
309309 }
310- mediaTypeApiMap . get ( MediaType ) ! . push ( api . apiName ) ;
310+ mediaTypeApiMap . get ( mediaType ) ! . push ( api . apiName ) ;
311311 }
312312 }
313313
314314 // Filter out media types with only one API
315315 const filteredMediaTypes = Array . from ( mediaTypeApiMap . entries ( ) ) . filter ( ( [ _ , apis ] ) => apis . length > 1 ) ;
316316
317317 // Dynamically create settings based on the filtered media types and their APIs
318- for ( const [ MediaType , apis ] of filteredMediaTypes ) {
319- new Setting ( containerEl ) . setName ( `Select APIs for ${ unCamelCase ( MediaType ) } ` ) . setHeading ( ) ;
318+ for ( const [ mediaType , apis ] of filteredMediaTypes ) {
319+ new Setting ( containerEl ) . setName ( `Select APIs for ${ unCamelCase ( mediaType ) } ` ) . setHeading ( ) ;
320320 for ( const apiName of apis ) {
321321 const api = this . plugin . apiManager . apis . find ( api => api . apiName === apiName ) ;
322322 if ( api ) {
323323 const disabledMediaTypes = api . getDisabledMediaTypes ( ) ;
324324 new Setting ( containerEl )
325325 . setName ( apiName )
326- . setDesc ( `Use ${ apiName } API for ${ unCamelCase ( MediaType ) } .` )
326+ . setDesc ( `Use ${ apiName } API for ${ unCamelCase ( mediaType ) } .` )
327327 . addToggle ( cb => {
328- cb . setValue ( ! disabledMediaTypes . includes ( MediaType as MediaType ) ) . onChange ( data => {
328+ cb . setValue ( ! disabledMediaTypes . includes ( mediaType ) ) . onChange ( data => {
329329 if ( data ) {
330- const index = disabledMediaTypes . indexOf ( MediaType as MediaType ) ;
330+ const index = disabledMediaTypes . indexOf ( mediaType ) ;
331331 if ( index > - 1 ) {
332332 disabledMediaTypes . splice ( index , 1 ) ;
333333 }
334334 } else {
335- disabledMediaTypes . push ( MediaType as MediaType ) ;
335+ disabledMediaTypes . push ( mediaType ) ;
336336 }
337337 void this . plugin . saveSettings ( ) ;
338338 } ) ;
0 commit comments