From 00c5ae79833a641ccc5f7d31b6eea3e91db4cb71 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 31 Jul 2021 12:30:31 -0400 Subject: DictionaryImporterMediaLoader (#1860) * Rename param for consistency * Move media loading functionality into DictionaryImporterMediaLoader * Create test class for media loading * Remove unnecessary Blob/Image/URL functionality --- ext/js/pages/settings/dictionary-import-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/js/pages/settings') diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index db9a1a50..128e18cb 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -19,6 +19,7 @@ * DictionaryController * DictionaryDatabase * DictionaryImporter + * DictionaryImporterMediaLoader */ class DictionaryImportController { @@ -184,7 +185,8 @@ class DictionaryImportController { async _importDictionary(file, importDetails, onProgress) { const dictionaryDatabase = await this._getPreparedDictionaryDatabase(); try { - const dictionaryImporter = new DictionaryImporter(); + const dictionaryImporterMediaLoader = new DictionaryImporterMediaLoader(); + const dictionaryImporter = new DictionaryImporter(dictionaryImporterMediaLoader); const archiveContent = await this._readFile(file); const {result, errors} = await dictionaryImporter.importDictionary(dictionaryDatabase, archiveContent, importDetails, onProgress); yomichan.api.triggerDatabaseUpdated('dictionary', 'import'); -- cgit v1.2.3