cleanup
This commit is contained in:
parent
04f9a0f543
commit
33d9d6ff57
@ -133,7 +133,7 @@ class Database {
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
async findTag(name, title) {
|
async findTagForTitle(name, title) {
|
||||||
if (!this.db) {
|
if (!this.db) {
|
||||||
throw 'database not initialized';
|
throw 'database not initialized';
|
||||||
}
|
}
|
||||||
|
@ -137,12 +137,14 @@ class Translator {
|
|||||||
async buildTags(names, title) {
|
async buildTags(names, title) {
|
||||||
const results = [];
|
const results = [];
|
||||||
for (const name of names) {
|
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};
|
const result = {name};
|
||||||
for (const prop in meta || {}) {
|
for (const prop in meta || {}) {
|
||||||
|
if (prop !== 'name') {
|
||||||
result[prop] = meta[prop];
|
result[prop] = meta[prop];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
results.push(dictTagSanitize(result));
|
results.push(dictTagSanitize(result));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user