summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-11 14:23:02 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-18 21:32:35 -0400
commitfd6ea0e404da2657f110599061af4034a524283a (patch)
treecc993d88a040a0870ccf465209e0bb794502de88 /ext/bg/js/backend.js
parent8106f4744b07833526d16acf656eda11d29b99ad (diff)
Add API for getting media data
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index e0814c17..8a19203f 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -111,7 +111,8 @@ class Backend {
['getAnkiModelFieldNames', {handler: this._onApiGetAnkiModelFieldNames.bind(this), async: true}],
['getDictionaryInfo', {handler: this._onApiGetDictionaryInfo.bind(this), async: true}],
['getDictionaryCounts', {handler: this._onApiGetDictionaryCounts.bind(this), async: true}],
- ['purgeDatabase', {handler: this._onApiPurgeDatabase.bind(this), async: true}]
+ ['purgeDatabase', {handler: this._onApiPurgeDatabase.bind(this), async: true}],
+ ['getMedia', {handler: this._onApiGetMedia.bind(this), async: true}]
]);
this._commandHandlers = new Map([
@@ -762,6 +763,10 @@ class Backend {
return await this.translator.purgeDatabase();
}
+ async _onApiGetMedia({targets}) {
+ return await this.database.getMedia(targets);
+ }
+
// Command handlers
async _onCommandSearch(params) {