diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-06-28 17:24:06 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-28 17:24:06 -0400 | 
| commit | 441c23bf3be1bc4f14e17ec3956a8c90b1a674e8 (patch) | |
| tree | 2ff8aef4f401f333df2d487814b741a005ca35d3 /ext/bg/js/backend.js | |
| parent | 7590055d4e809ab857b2d491dab256e66f1b34b6 (diff) | |
Rename Database to DictionaryDatabase (#633)
Diffstat (limited to 'ext/bg/js/backend.js')
| -rw-r--r-- | ext/bg/js/backend.js | 18 | 
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) {  |