Добавлено отображение количества найденных значений

This commit is contained in:
Book Pauk
2022-12-02 18:00:09 +07:00
parent 772ea3ca0c
commit 33aea2a194
4 changed files with 46 additions and 24 deletions

View File

@@ -65,14 +65,21 @@ class TitlePage extends BasePage {
//навигация по каталогу
const queryRes = await this.opdsQuery('title', query, '[Остальные названия]');
for (const rec of queryRes) {
entry.push(
this.makeEntry({
id: rec.id,
title: rec.title,
link: this.navLink({href: `/${this.id}?title=${rec.q}&genre=${encodeURIComponent(query.genre)}`}),
})
);
for (const rec of queryRes) {
const e = {
id: rec.id,
title: rec.title,
link: this.navLink({href: `/${this.id}?title=${rec.q}&genre=${encodeURIComponent(query.genre)}`}),
};
if (rec.count) {
e.content = {
'*ATTRS': {type: 'text'},
'*TEXT': `${rec.count} названий`,
};
}
entry.push(this.makeEntry(e));
}
}