diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index da6aeb6..f5c6546 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -150,6 +150,9 @@ +
@@ -508,19 +518,13 @@ class Search { getBookCount(item) { let result = ''; - if (!this.showCounts || item.bookCount === undefined) + if (!this.showCounts || item.count === undefined) return result; - if (this.showDeleted) { - result = item.bookCount + item.bookDelCount; - } else { - result = item.bookCount; - } - if (item.books) - result = `${item.books.length}/${result}`; + result = `${item.books.length}/${item.count}`; else - result = `#/${result}`; + result = `#/${item.count}`; return `(${result})`; } @@ -713,16 +717,22 @@ class Search { return; let num = 0; + this.hiddenCount = 0; for (const rec of authors) { this.cachedAuthors[rec.author] = rec; + const count = (this.showDeleted ? rec.bookCount + rec.bookDelCount : rec.bookCount); + if (!count) { + this.hiddenCount++; + continue; + } + const item = reactive({ key: rec.id, num, author: rec.author, name: rec.author.replace(/,/g, ', '), - bookCount: rec.bookCount, - bookDelCount: rec.bookDelCount, + count, book: false, }); num++;