Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
67825ae135
19 changed files with 1535 additions and 5272 deletions
|
|
@ -11,11 +11,13 @@ import { MusicBrainzAPI } from './api/apis/MusicBrainzAPI';
|
|||
import { MEDIA_TYPES, MediaTypeManager } from './utils/MediaTypeManager';
|
||||
import { SteamAPI } from './api/apis/SteamAPI';
|
||||
import { BoardGameGeekAPI } from './api/apis/BoardGameGeekAPI';
|
||||
import { OpenLibraryAPI } from './api/apis/OpenLibraryAPI';
|
||||
import { PropertyMapper } from './settings/PropertyMapper';
|
||||
import { YAMLConverter } from './utils/YAMLConverter';
|
||||
import { MediaDbFolderImportModal } from './modals/MediaDbFolderImportModal';
|
||||
import { PropertyMapping, PropertyMappingModel } from './settings/PropertyMapping';
|
||||
import { ModalHelper, ModalResultCode, SearchModalOptions } from './utils/ModalHelper';
|
||||
import { DateFormatter } from './utils/DateFormatter';
|
||||
|
||||
export default class MediaDbPlugin extends Plugin {
|
||||
settings: MediaDbPluginSettings;
|
||||
|
|
@ -23,6 +25,7 @@ export default class MediaDbPlugin extends Plugin {
|
|||
mediaTypeManager: MediaTypeManager;
|
||||
modelPropertyMapper: PropertyMapper;
|
||||
modalHelper: ModalHelper;
|
||||
dateFormatter: DateFormatter;
|
||||
|
||||
frontMatterRexExpPattern: string = '^(---)\\n[\\s\\S]*?\\n---';
|
||||
|
||||
|
|
@ -36,11 +39,13 @@ export default class MediaDbPlugin extends Plugin {
|
|||
this.apiManager.registerAPI(new MusicBrainzAPI(this));
|
||||
this.apiManager.registerAPI(new SteamAPI(this));
|
||||
this.apiManager.registerAPI(new BoardGameGeekAPI(this));
|
||||
this.apiManager.registerAPI(new OpenLibraryAPI(this));
|
||||
// this.apiManager.registerAPI(new LocGovAPI(this)); // TODO: parse data
|
||||
|
||||
this.mediaTypeManager = new MediaTypeManager();
|
||||
this.modelPropertyMapper = new PropertyMapper(this);
|
||||
this.modalHelper = new ModalHelper(this);
|
||||
this.dateFormatter = new DateFormatter();
|
||||
|
||||
await this.loadSettings();
|
||||
// register the settings tab
|
||||
|
|
@ -48,6 +53,7 @@ export default class MediaDbPlugin extends Plugin {
|
|||
|
||||
this.mediaTypeManager.updateTemplates(this.settings);
|
||||
this.mediaTypeManager.updateFolders(this.settings);
|
||||
this.dateFormatter.setFormat(this.settings.customDateFormat);
|
||||
|
||||
// add icon to the left ribbon
|
||||
const ribbonIconEl = this.addRibbonIcon('database', 'Add new Media DB entry', () => this.createEntryWithAdvancedSearchModal());
|
||||
|
|
@ -565,6 +571,7 @@ export default class MediaDbPlugin extends Plugin {
|
|||
async saveSettings(): Promise<void> {
|
||||
this.mediaTypeManager.updateTemplates(this.settings);
|
||||
this.mediaTypeManager.updateFolders(this.settings);
|
||||
this.dateFormatter.setFormat(this.settings.customDateFormat);
|
||||
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue