aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 547b32d0..4791bfb5 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -21,7 +21,7 @@
* AudioSystem
* AudioUriBuilder
* ClipboardMonitor
- * Database
+ * DictionaryDatabase
* DictionaryImporter
* Environment
* JsonSchema
@@ -43,9 +43,9 @@
class Backend {
constructor() {
this._environment = new Environment();
- this._database = new Database();
+ this._dictionaryDatabase = new DictionaryDatabase();
this._dictionaryImporter = new DictionaryImporter();
- this._translator = new Translator(this._database);
+ this._translator = new Translator(this._dictionaryDatabase);
this._anki = new AnkiConnect();
this._mecab = new Mecab();
this._clipboardMonitor = new ClipboardMonitor({getClipboard: this._onApiClipboardGet.bind(this)});
@@ -193,7 +193,7 @@ class Backend {
await this._environment.prepare();
try {
- await this._database.prepare();
+ await this._dictionaryDatabase.prepare();
} catch (e) {
yomichan.logError(e);
}
@@ -709,11 +709,11 @@ class Backend {
async _onApiPurgeDatabase() {
this._translator.clearDatabaseCaches();
- await this._database.purge();
+ await this._dictionaryDatabase.purge();
}
async _onApiGetMedia({targets}) {
- return await this._database.getMedia(targets);
+ return await this._dictionaryDatabase.getMedia(targets);
}
_onApiLog({error, level, context}) {
@@ -747,12 +747,12 @@ class Backend {
}
async _onApiImportDictionaryArchive({archiveContent, details}, sender, onProgress) {
- return await this._dictionaryImporter.import(this._database, archiveContent, details, onProgress);
+ return await this._dictionaryImporter.import(this._dictionaryDatabase, archiveContent, details, onProgress);
}
async _onApiDeleteDictionary({dictionaryName}, sender, onProgress) {
this._translator.clearDatabaseCaches();
- await this._database.deleteDictionary(dictionaryName, {rate: 1000}, onProgress);
+ await this._dictionaryDatabase.deleteDictionary(dictionaryName, {rate: 1000}, onProgress);
}
async _onApiModifySettings({targets, source}) {
@@ -966,7 +966,7 @@ class Backend {
}
async _importDictionary(archiveSource, onProgress, details) {
- return await this._dictionaryImporter.import(this._database, archiveSource, onProgress, details);
+ return await this._dictionaryImporter.import(this._dictionaryDatabase, archiveSource, onProgress, details);
}
async _textParseScanning(text, options) {