This commit is contained in:
Alex Yatskov 2017-09-13 18:03:55 -07:00
parent 04f9a0f543
commit 33d9d6ff57
2 changed files with 5 additions and 3 deletions

View File

@ -133,7 +133,7 @@ class Database {
return results;
}
async findTag(name, title) {
async findTagForTitle(name, title) {
if (!this.db) {
throw 'database not initialized';
}

View File

@ -137,12 +137,14 @@ 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 || {}) {
if (prop !== 'name') {
result[prop] = meta[prop];
}
}
results.push(dictTagSanitize(result));
}