From 33d9d6ff573d72a8b1600b23b20faf2b0ca4419c Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 13 Sep 2017 18:03:55 -0700 Subject: [PATCH] cleanup --- ext/bg/js/database.js | 2 +- ext/bg/js/translator.js | 6 ++++-- 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));