summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-18 22:01:08 -0500
committerGitHub <noreply@github.com>2021-01-18 22:01:08 -0500
commit21fce9f3d98e4381f8813cf9c63410ca1dbd7f91 (patch)
tree124a510e4f208bbd7516b2eae98454400e9b4c54 /ext/bg/js/backend.js
parent85c723b85f47ff3048ba7aca46a532aa1bc44064 (diff)
Audio system refactoring (#1275)
* Simplify details * Simplify audio creation * Return an array of sources instead of a single item * Use sourceIndex instead of index * Rename APIs * Return more info about the source * Return source instead of sourceIndex
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 433f5a93..2949cbed 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -99,7 +99,7 @@ class Backend {
['noteView', {async: true, contentScript: true, handler: this._onApiNoteView.bind(this)}],
['suspendAnkiCardsForNote', {async: true, contentScript: true, handler: this._onApiSuspendAnkiCardsForNote.bind(this)}],
['commandExec', {async: false, contentScript: true, handler: this._onApiCommandExec.bind(this)}],
- ['getDefinitionAudioInfo', {async: true, contentScript: true, handler: this._onApiGetDefinitionAudioInfo.bind(this)}],
+ ['getExpressionAudioInfoList', {async: true, contentScript: true, handler: this._onApiGetExpressionAudioInfoList.bind(this)}],
['downloadDefinitionAudio', {async: true, contentScript: true, handler: this._onApiDownloadDefinitionAudio.bind(this)}],
['screenshotGet', {async: true, contentScript: true, handler: this._onApiScreenshotGet.bind(this)}],
['sendMessageToFrame', {async: false, contentScript: true, handler: this._onApiSendMessageToFrame.bind(this)}],
@@ -500,8 +500,8 @@ class Backend {
return this._runCommand(command, params);
}
- async _onApiGetDefinitionAudioInfo({source, expression, reading, details}) {
- return await this._audioDownloader.getInfo(source, expression, reading, details);
+ async _onApiGetExpressionAudioInfoList({source, expression, reading, details}) {
+ return await this._audioDownloader.getExpressionAudioInfoList(source, expression, reading, details);
}
async _onApiDownloadDefinitionAudio({sources, expression, reading, details}) {
@@ -1528,7 +1528,7 @@ class Backend {
}
async _downloadDefinitionAudio(sources, expression, reading, details) {
- return await this._audioDownloader.downloadAudio(sources, expression, reading, details);
+ return await this._audioDownloader.downloadExpressionAudio(sources, expression, reading, details);
}
async _injectAnkNoteMedia(ankiConnect, timestamp, definitionDetails, audioDetails, screenshotDetails, clipboardDetails) {