@@ -22,27 +22,31 @@ export interface MediaDbPluginSettings {
2222 wikiTemplate : string ;
2323 musicReleaseTemplate : string ;
2424 boardgameTemplate : string ;
25+ bookTemplate : string ;
2526
2627 movieFileNameTemplate : string ;
2728 seriesFileNameTemplate : string ;
2829 gameFileNameTemplate : string ;
2930 wikiFileNameTemplate : string ;
3031 musicReleaseFileNameTemplate : string ;
3132 boardgameFileNameTemplate : string ;
33+ bookFileNameTemplate : string ;
3234
3335 moviePropertyConversionRules : string ;
3436 seriesPropertyConversionRules : string ;
3537 gamePropertyConversionRules : string ;
3638 wikiPropertyConversionRules : string ;
3739 musicReleasePropertyConversionRules : string ;
3840 boardgamePropertyConversionRules : string ;
41+ bookPropertyConversionRules : string ;
3942
4043 movieFolder : string ;
4144 seriesFolder : string ;
4245 gameFolder : string ;
4346 wikiFolder : string ;
4447 musicReleaseFolder : string ;
4548 boardgameFolder : string ;
49+ bookFolder : string ;
4650
4751 propertyMappingModels : PropertyMappingModel [ ] ;
4852}
@@ -60,27 +64,31 @@ const DEFAULT_SETTINGS: MediaDbPluginSettings = {
6064 wikiTemplate : '' ,
6165 musicReleaseTemplate : '' ,
6266 boardgameTemplate : '' ,
67+ bookTemplate : '' ,
6368
6469 movieFileNameTemplate : '{{ title }} ({{ year }})' ,
6570 seriesFileNameTemplate : '{{ title }} ({{ year }})' ,
6671 gameFileNameTemplate : '{{ title }} ({{ year }})' ,
6772 wikiFileNameTemplate : '{{ title }}' ,
6873 musicReleaseFileNameTemplate : '{{ title }} (by {{ ENUM:artists }} - {{ year }})' ,
6974 boardgameFileNameTemplate : '{{ title }} ({{ year }})' ,
75+ bookFileNameTemplate : '{{ title }} ({{ year }})' ,
7076
7177 moviePropertyConversionRules : '' ,
7278 seriesPropertyConversionRules : '' ,
7379 gamePropertyConversionRules : '' ,
7480 wikiPropertyConversionRules : '' ,
7581 musicReleasePropertyConversionRules : '' ,
7682 boardgamePropertyConversionRules : '' ,
83+ bookPropertyConversionRules : '' ,
7784
7885 movieFolder : 'Media DB/movies' ,
7986 seriesFolder : 'Media DB/series' ,
8087 gameFolder : 'Media DB/games' ,
8188 wikiFolder : 'Media DB/wiki' ,
8289 musicReleaseFolder : 'Media DB/music' ,
8390 boardgameFolder : 'Media DB/boardgames' ,
91+ bookFolder : 'Media DB/books' ,
8492
8593 propertyMappingModels : [ ] ,
8694} ;
@@ -194,7 +202,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
194202 // region new file location
195203 new Setting ( containerEl )
196204 . setName ( 'Movie Folder' )
197- . setDesc ( 'Where newly imported movies should be places .' )
205+ . setDesc ( 'Where newly imported movies should be placed .' )
198206 . addSearch ( cb => {
199207 new FolderSuggest ( this . app , cb . inputEl ) ;
200208 cb . setPlaceholder ( DEFAULT_SETTINGS . movieFolder )
@@ -207,7 +215,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
207215
208216 new Setting ( containerEl )
209217 . setName ( 'Series Folder' )
210- . setDesc ( 'Where newly imported series should be places .' )
218+ . setDesc ( 'Where newly imported series should be placed .' )
211219 . addSearch ( cb => {
212220 new FolderSuggest ( this . app , cb . inputEl ) ;
213221 cb . setPlaceholder ( DEFAULT_SETTINGS . seriesFolder )
@@ -220,7 +228,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
220228
221229 new Setting ( containerEl )
222230 . setName ( 'Game Folder' )
223- . setDesc ( 'Where newly imported games should be places .' )
231+ . setDesc ( 'Where newly imported games should be placed .' )
224232 . addSearch ( cb => {
225233 new FolderSuggest ( this . app , cb . inputEl ) ;
226234 cb . setPlaceholder ( DEFAULT_SETTINGS . gameFolder )
@@ -233,7 +241,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
233241
234242 new Setting ( containerEl )
235243 . setName ( 'Wiki Folder' )
236- . setDesc ( 'Where newly imported wiki articles should be places .' )
244+ . setDesc ( 'Where newly imported wiki articles should be placed .' )
237245 . addSearch ( cb => {
238246 new FolderSuggest ( this . app , cb . inputEl ) ;
239247 cb . setPlaceholder ( DEFAULT_SETTINGS . wikiFolder )
@@ -246,7 +254,7 @@ export class MediaDbSettingTab extends PluginSettingTab {
246254
247255 new Setting ( containerEl )
248256 . setName ( 'Music Folder' )
249- . setDesc ( 'Where newly imported music should be places .' )
257+ . setDesc ( 'Where newly imported music should be placed .' )
250258 . addSearch ( cb => {
251259 new FolderSuggest ( this . app , cb . inputEl ) ;
252260 cb . setPlaceholder ( DEFAULT_SETTINGS . musicReleaseFolder )
@@ -269,6 +277,18 @@ export class MediaDbSettingTab extends PluginSettingTab {
269277 this . plugin . saveSettings ( ) ;
270278 } ) ;
271279 } ) ;
280+ new Setting ( containerEl )
281+ . setName ( 'Book Folder' )
282+ . setDesc ( 'Where newly imported books should be placed.' )
283+ . addSearch ( cb => {
284+ new FolderSuggest ( this . app , cb . inputEl ) ;
285+ cb . setPlaceholder ( DEFAULT_SETTINGS . bookFolder )
286+ . setValue ( this . plugin . settings . bookFolder )
287+ . onChange ( data => {
288+ this . plugin . settings . bookFolder = data ;
289+ this . plugin . saveSettings ( ) ;
290+ } ) ;
291+ } ) ;
272292 // endregion
273293
274294 containerEl . createEl ( 'h3' , { text : 'Template Settings' } ) ;
@@ -350,6 +370,19 @@ export class MediaDbSettingTab extends PluginSettingTab {
350370 this . plugin . saveSettings ( ) ;
351371 } ) ;
352372 } ) ;
373+
374+ new Setting ( containerEl )
375+ . setName ( 'Book template' )
376+ . setDesc ( 'Template file to be used when creating a new note for a book.' )
377+ . addSearch ( cb => {
378+ new FileSuggest ( this . app , cb . inputEl ) ;
379+ cb . setPlaceholder ( 'Example: bookTemplate.md' )
380+ . setValue ( this . plugin . settings . bookTemplate )
381+ . onChange ( data => {
382+ this . plugin . settings . bookTemplate = data ;
383+ this . plugin . saveSettings ( ) ;
384+ } ) ;
385+ } ) ;
353386 // endregion
354387
355388 containerEl . createEl ( 'h3' , { text : 'File Name Settings' } ) ;
@@ -425,6 +458,18 @@ export class MediaDbSettingTab extends PluginSettingTab {
425458 this . plugin . saveSettings ( ) ;
426459 } ) ;
427460 } ) ;
461+
462+ new Setting ( containerEl )
463+ . setName ( 'Book file name template' )
464+ . setDesc ( 'Template for the file name used when creating a new note for a book.' )
465+ . addText ( cb => {
466+ cb . setPlaceholder ( `Example: ${ DEFAULT_SETTINGS . bookFileNameTemplate } ` )
467+ . setValue ( this . plugin . settings . bookFileNameTemplate )
468+ . onChange ( data => {
469+ this . plugin . settings . bookFileNameTemplate = data ;
470+ this . plugin . saveSettings ( ) ;
471+ } ) ;
472+ } ) ;
428473 // endregion
429474
430475 // region Property Mappings
0 commit comments