aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-07-31 12:30:31 -0400
committerGitHub <noreply@github.com>2021-07-31 12:30:31 -0400
commit00c5ae79833a641ccc5f7d31b6eea3e91db4cb71 (patch)
treee21cb14527e2bf6e74b36eeab75e994d52df37b6 /ext/js/pages/settings
parent2d57d69b9ed3adf1241074f7eb29a588bec817a2 (diff)
DictionaryImporterMediaLoader (#1860)
* Rename param for consistency * Move media loading functionality into DictionaryImporterMediaLoader * Create test class for media loading * Remove unnecessary Blob/Image/URL functionality
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js4
1 files changed, 3 insertions, 1 deletions
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');