aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-24 22:22:40 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-24 22:22:40 -0500
commit00bbcff8a2ad8fced8b3216fad1c8c747ddf595b (patch)
tree374be924b250ed55c45c62fc23a57f4fec7045cd /ext/bg
parentd7ce82910745bc1d7661a5d19b89437025d2e32f (diff)
Fix findTermMetaBulk and findKanjiMetaBulk not returning expression/character
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/database.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 42a143f3..e87cc64b 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -225,7 +225,7 @@ class Database {
}
async findTermMetaBulk(termList, titles) {
- return this.findGenericBulk('termMeta', 'expression', termList, titles, Database.createMeta);
+ return this.findGenericBulk('termMeta', 'expression', termList, titles, Database.createTermMeta);
}
async findKanjiBulk(kanjiList, titles) {
@@ -233,7 +233,7 @@ class Database {
}
async findKanjiMetaBulk(kanjiList, titles) {
- return this.findGenericBulk('kanjiMeta', 'character', kanjiList, titles, Database.createMeta);
+ return this.findGenericBulk('kanjiMeta', 'character', kanjiList, titles, Database.createKanjiMeta);
}
async findGenericBulk(tableName, indexName, indexValueList, titles, createResult) {
@@ -632,13 +632,12 @@ class Database {
};
}
- static createMeta(row, index) {
- return {
- index,
- mode: row.mode,
- data: row.data,
- dictionary: row.dictionary
- };
+ static createTermMeta({expression, mode, data, dictionary}, index) {
+ return {expression, mode, data, dictionary, index};
+ }
+
+ static createKanjiMeta({character, mode, data, dictionary}, index) {
+ return {character, mode, data, dictionary, index};
}
static getAll(dbIndex, query, context, processRow) {