aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-09-13 18:03:55 -0700
committerAlex Yatskov <alex@foosoft.net>2017-09-13 18:03:55 -0700
commit33d9d6ff573d72a8b1600b23b20faf2b0ca4419c (patch)
tree974267041c319fa06e587911d9969631da45e300
parent04f9a0f54316d123628168aa5a15e8e48907d783 (diff)
cleanup
-rw-r--r--ext/bg/js/database.js2
-rw-r--r--ext/bg/js/translator.js6
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 630243b2..b56cf7e2 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -133,7 +133,7 @@ class Database {
return results;
}
- async findTag(name, title) {
+ async findTagForTitle(name, title) {
if (!this.db) {
throw 'database not initialized';
}
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 5de99e8e..0ecae16b 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -137,11 +137,13 @@ class Translator {
async buildTags(names, title) {
const results = [];
for (const name of names) {
- const meta = await this.database.findTag(name.split(':')[0], title);
+ const meta = await this.database.findTagForTitle(name.split(':')[0], title);
const result = {name};
for (const prop in meta || {}) {
- result[prop] = meta[prop];
+ if (prop !== 'name') {
+ result[prop] = meta[prop];
+ }
}
results.push(dictTagSanitize(result));