diff options
author | Alex Yatskov <alex@foosoft.net> | 2020-01-26 11:29:30 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2020-01-26 11:29:30 -0800 |
commit | 0c5b9b1fa1599cbf769d96cdebc226310f9dd8bc (patch) | |
tree | e734e2c3005078dbc248b541d357a934baa8a116 /ext/bg/js/database.js | |
parent | 2a12036ca305044291f1f4105d6a8d249848b210 (diff) | |
parent | 0cf1cf3aa094585bd6db8db2c1f229ba0ea37b6e (diff) |
Merge branch 'master' into testing
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r-- | ext/bg/js/database.js | 17 |
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) { |